https://github.com/hellodword/cf-workers-tpl
https://github.com/hellodword/cf-workers-tpl
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hellodword/cf-workers-tpl
- Owner: hellodword
- Created: 2025-02-17T13:28:40.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-18T12:14:23.000Z (over 1 year ago)
- Last Synced: 2025-10-12T00:53:52.925Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cf-workers-tpl
## Motivation
1. Cloudflare officially does not consider routes, bindings, and other account-related information as sensitive, but I believe they should not be included in the source code. Additionally, they are not easily configurable via environment variables. As a result, if someone who just wants to deploy and use the project obtains the source code, they would need to modify configuration files within the Git repository to make it work, making the local `git status` dirty—which I dislike.
2. According to the documentation, using service binding seems to require writing code in two separate directories. However, I use serverless for convenience, and I don’t like this additional complexity.
## Usage
```shell
npm ci
# minimal scopes
npx wrangler login --scopes account:read --scopes user:read --scopes workers_scripts:write --scopes workers_routes:write --scopes zone:read
npx wrangler whoami
# create wrangler-custom.json
npm run dev:all
npm run deploy:all
```