Skip to content

Serverless boilerplate for Static website hosting with Basic authentication

Notifications You must be signed in to change notification settings

k1LoW/serverless-static-hosting-with-basic-auth

Repository files navigation

Serverless boilerplate for Static website hosting with Basic authentication Build Status

Architecture

[CloudFront (with Lambda@Edge)] -Restrict Bucket Access-> [S3 Origin Bucket] <-Sync- [Local src/*]

Using plugin

Usage

Install boilerplate

$ git clone https://github.com/k1LoW/serverless-static-hosting-with-basic-auth.git ./my-static-page

Set Basic authentication USERNAME:PASS

Set Basic authentication config ( handler.js )

Deploy stack

$ npm install
$ AWS_PROFILE=XxxxxXXX WEBSITE_S3_BUCKET_NAME=sls-static-basic npm run deploy

Synchronize src/* -> Website

$ AWS_PROFILE=XxxxxXXX WEBSITE_S3_BUCKET_NAME=sls-static-basic npm run sync

Remove stack

$ AWS_PROFILE=XxxxxXXX WEBSITE_S3_BUCKET_NAME=sls-static-basic npm run remove