Skip to content

Latest commit

 

History

History
 
 

worker-openapi

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Template: worker-openapi

Deploy to Cloudflare Workers

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!

Setup

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.

Local development

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.

Deploy

Once you are ready, you can publish your code by running the following command:

$ wrangler publish