https://github.com/k1low/serverless-static-hosting-with-basic-auth
  
  
    Serverless boilerplate for Static website hosting with Basic authentication 
    https://github.com/k1low/serverless-static-hosting-with-basic-auth
  
basic-authentication biolerplate serverless static-hosting
        Last synced: 7 months ago 
        JSON representation
    
Serverless boilerplate for Static website hosting with Basic authentication
- Host: GitHub
 - URL: https://github.com/k1low/serverless-static-hosting-with-basic-auth
 - Owner: k1LoW
 - Created: 2018-01-09T11:10:15.000Z (almost 8 years ago)
 - Default Branch: master
 - Last Pushed: 2019-03-18T11:37:52.000Z (over 6 years ago)
 - Last Synced: 2025-03-29T05:41:34.113Z (7 months ago)
 - Topics: basic-authentication, biolerplate, serverless, static-hosting
 - Language: JavaScript
 - Size: 9.77 KB
 - Stars: 21
 - Watchers: 3
 - Forks: 8
 - Open Issues: 1
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
README
          # Serverless boilerplate for Static website hosting with Basic authentication [](https://travis-ci.org/k1LoW/serverless-static-hosting-with-basic-auth)
## Architecture
```
[CloudFront (with Lambda@Edge)] -Restrict Bucket Access-> [S3 Origin Bucket] <-Sync- [Local src/*]
```
### Using plugin
- [serverless-plugin-cloudfront-lambda-edge](https://github.com/silvermine/serverless-plugin-cloudfront-lambda-edge)
- [serverless-s3-sync](https://github.com/k1LoW/serverless-s3-sync)
## 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
```