Cloudflare Worker Deployment
Prerequisites
- Ensure CLOUDFLARE_API_TOKEN is set in environment
- Verify wrangler.toml exists in worker directory
Deployment Steps
Main Worker
cd workers/main
npm run build:worker
npx wrangler deploy
Search Consumer Worker
cd workers/search-consumer
npm run build:consumer
npx wrangler deploy
Verification
After deployment, tail logs to verify:
timeout 15 npx wrangler tail
Common Issues
- Authentication failed: Check CLOUDFLARE_API_TOKEN
- Build errors: Run
npm installfirst - Route conflicts: Check wrangler.toml routes
Rollback
If deployment fails:
npx wrangler rollback