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:
$ npm init cloudflare my-project worker-openapi
# or
$ yarn create cloudflare my-project worker-openapi
# or
$ pnpm create cloudflare my-project worker-openapi
Note: Each command invokes
create-cloudflare
for project creation.
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 publish