This template demonstrates using the itty-router-openapi
package to add openapi 3 schema generation and validation.
You can try this template in your browser here!
To create a my-project
directory using this template, run:
$ npx wrangler generate my-project worker-openapi
# or
$ yarn wrangler generate my-project worker-openapi
# or
$ pnpm wrangler generate my-project worker-openapi
Run wrangler dev
and head to /docs
our /redocs
with your browser.
You'll be greeted with an OpenAPI page that you can use to test and call your endpoints.
Once you are ready, you can publish your code by running the following command:
$ wrangler deploy