Run these from the project root.
npx wrangler login
npx wrangler whoaminpx wrangler r2 bucket create note-prod
npx wrangler r2 bucket create note-preview
npx wrangler r2 bucket listThis project is already configured for:
name = "note"
main = "src/index.ts"
compatibility_date = "2026-03-10"
workers_dev = true
[[r2_buckets]]
binding = "NOTES_BUCKET"
bucket_name = "note-prod"
preview_bucket_name = "note-preview"If you want different names, update them before deploy.
npm ci
npm run verifynpx wrangler deployAfter deploy, Wrangler will print your workers.dev URL.
Replace YOUR-WORKER.workers.dev below.
curl -I https://YOUR-WORKER.workers.dev/curl -X POST https://YOUR-WORKER.workers.dev/ \
-H 'Content-Type: application/json' \
-H 'User-Agent: curl/8.0.0' \
-d '{"content":"hello from workers"}'This returns a URL like:
https://YOUR-WORKER.workers.dev/noteid/ABCDE
curl https://YOUR-WORKER.workers.dev/noteid/ABCDEcurl -X POST https://YOUR-WORKER.workers.dev/noteid/ABCDE \
-H 'Content-Type: application/json' \
-d '{"noteId":"ABCDE","content":""}'The deploy workflow uses cloudflare/wrangler-action@v3.
Set these secrets in GitHub Actions:
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_ID
CLOUDFLARE_WORKER_NAME
If omitted, the workflow deploys as note.
If you use GitHub CLI and have access to the repo:
gh secret set CLOUDFLARE_API_TOKEN --body 'YOUR_CLOUDFLARE_API_TOKEN'
gh secret set CLOUDFLARE_ACCOUNT_ID --body 'YOUR_CLOUDFLARE_ACCOUNT_ID'
gh variable set CLOUDFLARE_WORKER_NAME --body 'note'Create an API token with at least:
- Workers Scripts: Edit
- Workers R2 Storage: Edit
Use the Cloudflare dashboard to create the token, then store it as CLOUDFLARE_API_TOKEN.
Create and push a tag beginning with v:
git tag v0.0.1
git push origin v0.0.1Run the Deploy Worker workflow from the GitHub Actions UI.
- open
/ - create a note in the browser
- confirm URL changes to
/noteid/:id - reload the note URL
- clear content and confirm delete behavior
- test curl GET and curl POST