This is just used for quickly prototyping handlers with TS.
Update wrangler.toml
with your information
yarn
yarn dev
wrangler preview
The router returns the specified request handler, and will return the request method for the given request.
This comes with mocha tests which simply test that the request handler can handle each request method. yarn test
will run your tests.
This uses prettier
to format the project. To invoke, run yarn format
.
Github actions will automatically deploy anything pushed to main
.
For information on how to preview and publish workers, please see the Wrangler docs.
The service-worker-mock
used by the tests is not a perfect representation of the Cloudflare Workers runtime. It is a general approximation. We recommend that you test end to end with wrangler dev
in addition to a staging environment to test things before deploying.