Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dommmel/cloudflare-workers-basic-auth
Basic http auth via cloudflare workers
https://github.com/dommmel/cloudflare-workers-basic-auth
Last synced: 13 days ago
JSON representation
Basic http auth via cloudflare workers
- Host: GitHub
- URL: https://github.com/dommmel/cloudflare-workers-basic-auth
- Owner: dommmel
- Created: 2019-04-13T08:12:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T13:51:17.000Z (over 4 years ago)
- Last Synced: 2024-08-01T16:34:38.785Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 109
- Watchers: 5
- Forks: 29
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cloudflare - Basic Auth - Protection using basic auth. (Workers / Recipes)
- awesome-cloudflare - Basic Auth - Protection using basic auth. (Workers / Recipes)
README
Most of the code has been copy-pasted from https://github.com/jshttp/basic-auth
# Why
I use it to protect static html pages.
# Usage
1. Set credentials in `index.js`
```
const NAME = "super"
const PASS = "secret"
```
3. Save and copy `index.js` to your cloudflare worker and deploy