Giter VIP home page Giter VIP logo

s4's Introduction

S4

S4 ("S3 Search") enables quick searches on static websites hosted with S3. Users enter their query as part of the URL path. For example, search.example.com/code might redirect to example.com/pages/how-to-write-clean-code.html. The project exists as a Lambda behind API Gateway. This project was bootstrapped with Chalice.

Try the project at s.penson.io! This page will search my wiki.

Deployment

First, install requirements.

cd s4
virtualenv -p python3 venv
. venv/bin/activate
pip install -r requirements.txt

Then, deploy with Chalice.

chalice deploy.

Development

View logs with Chalice.

chalice logs

Run tests with pytest.

python -m pytest

Note that you'll need to install dependencies from tests/requirements.txt.

Configuration

This project relies on one environment variable. BUCKET holds the name of the S3 bucket you'd like to search. Edit this value in s4/.chalice/config.json.

Custom Domain

Follow the steps below to serve the search from a custom domain name. These steps assume that you have a domain registered with Route53.

  1. Navigate to API Gateway from the AWS console.
  2. Click Custom Domain Names in the sidebar.
  3. Select Create Custom Domain Name and enter your domain name.
  4. Add a Base Path Mapping with a destination of s4:api.
  5. Navigate to Route53 from the AWS console.
  6. Click Hosted zones and select your domain name.
  7. Select Create Record Set and enter a subdomain (I chose s).
  8. Choose A - IPv4 as the type.
  9. Toggle Yes under Alias and look for the API Gateway API under Alias Target.
  10. Lastly, click Create.

s4's People

Contributors

elliotpenson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.