starters/adapters/cloudflare-workers/README.md
Cloudflare's wrangler CLI can be used to preview a production build locally. To start a local server, run:
npm run serve
Then visit http://localhost:8787/
Cloudflare Workers can be deployed using the Wrangler CLI.
If you don't already have an account, then create a Cloudflare account here.
Once authenticated, you can deploy your Worker:
npm run deploy
The wrangler.jsonc file contains your Worker configuration. Key settings include:
./dist/_worker.js)After adding any binding, use this command to regenerate the worker-configuration.d.ts file
npm run cf-typegen
For more details, see the Wrangler configuration documentation.
Cloudflare Workers can interact with various Cloudflare resources through bindings:
Configure bindings in your wrangler.jsonc file. See the bindings documentation for more information.