This is a Cloudflare Worker with OpenAPI 3.1 Auto Generation and Validation using chanfana and Hono.
This is an lab project made to be used for training in CX flows that consume OpenAPI compliant web services that generates the openapi.json
schema automatically from code and validates the incoming request to the defined parameters or request body.
This template includes various endpoints.
This template includes integration tests using Vitest. To run the tests locally:
pnpm run test
Test files are located in the tests/
directory, with examples demonstrating how to test your endpoints and database interactions.
- Main router is defined in
src/index.ts
. - Each endpoint has its own file in
src/endpoints/
. - Integration tests are located in the
tests/
directory. - For more information read the chanfana documentation, Hono documentation, and Vitest documentation.