Basic auth pages that query an AWS lambda function, and redirect if matched.
- Create a new AWS lambda function. We named ours alumRedir. Use Python 3.8 as the enviroment.
- Paste the code from this repo's
lambda_function.py
into the editor on AWS. - Create enviroment variables
index
,join
, andpassword
and set them to their respective values. - Add a new trigger, and select API Gateway. Then, create an api and select HTTP api. It should have open security.
- Edit the new API gatway. Specifically, go to CORS settings. Edit to match what's given below. Maybe it's not necessary to expose all of that, but it works for us.
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: *
Access-Control-Expose-Headers *
- Update the url in
request.js
to point to your API gateway.
You should be done!
- Replace the url in
.gitmodules
with whatever other repo contains your branding/styles (or remove alltogether). - Update
style.css
to reflect new colors/layout. - Replace meta information and images in
index.html
andjoin.html
. - Update
Origin
header andfetch
url inrequest.js
. - Deploy! We use Github pages and route it to a subdomain of ours.