Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-18T11:37:52.000Z (over 5 years ago)
- Last Synced: 2024-10-06T04:16:15.018Z (about 2 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 [![Build Status](https://travis-ci.org/k1LoW/serverless-static-hosting-with-basic-auth.svg?branch=master)](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
```