-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,8 @@ | ||
# Cloudflare Workers OpenAPI 3.1 | ||
|
||
This is a Cloudflare Worker with OpenAPI 3.1 using | ||
[itty-router-openapi](https://github.com/cloudflare/itty-router-openapi). | ||
|
||
This is an example project made to be used as a quick start into building | ||
OpenAPI compliant Workers that generates the `openapi.json` schema automatically | ||
from code and validates the incoming request to the defined parameters or | ||
request body. | ||
|
||
## Get started | ||
|
||
1. Sign up for [Cloudflare Workers](https://workers.dev). The free tier is more | ||
than enough for most use cases. | ||
2. Clone this project and install dependencies with `npm install` | ||
3. Run `wrangler login` to login to your Cloudflare account in wrangler | ||
4. Run `wrangler deploy` to publish the API to Cloudflare Workers | ||
|
||
## Project structure | ||
|
||
1. Your main router is defined in `src/index.ts`. | ||
2. Each endpoint has its own file in `src/endpoints/`. | ||
3. For more information read the | ||
[itty-router-openapi official documentation](https://cloudflare.github.io/itty-router-openapi/). | ||
|
||
## Development | ||
|
||
1. Run `wrangler dev` to start a local instance of the API. | ||
2. Open `http://localhost:9000/` in your browser to see the Swagger interface | ||
where you can try the endpoints. | ||
3. Changes made in the `src/` folder will automatically trigger the server to | ||
reload, you only need to refresh the Swagger interface. | ||
# API de poesía | ||
[![codecov](https://codecov.io/github/carafelix/poesia-api/graph/badge.svg?token=IFV2KESJWK)](https://codecov.io/github/carafelix/poesia-api) | ||
Stack: | ||
- Router: Hono | ||
- OpenAPI solution: Chanafa | ||
- Data: Xata, Drizzle, Zod | ||
- Testing: Vitest, Istanbul, codecov | ||
- Local: Wrangler, gh Act |