Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/14f3v/laos-postcode
laos-postcode api which hosted on cloudflare workers
https://github.com/14f3v/laos-postcode
cloudflare-workers honojs openapi
Last synced: about 1 month ago
JSON representation
laos-postcode api which hosted on cloudflare workers
- Host: GitHub
- URL: https://github.com/14f3v/laos-postcode
- Owner: 14f3v
- Created: 2024-07-15T06:26:13.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-15T11:11:45.000Z (4 months ago)
- Last Synced: 2024-09-26T10:36:00.885Z (about 1 month ago)
- Topics: cloudflare-workers, honojs, openapi
- Language: TypeScript
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Release
* You can checkout [PostCode exposed API here](https://laos-postcode.phimasonelabs.workers.dev/#/Postcodes/get_PostCodeLists)
# Development
## Cloudflare Workers OpenAPI 3.1
This is a Cloudflare Worker with OpenAPI 3.1 using [chanfana](https://github.com/cloudflare/chanfana) and [Hono](https://github.com/honojs/hono).
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 [chanfana documentation](https://chanfana.pages.dev/) and [Hono documentation](https://hono.dev/docs).## Development
1. Run `wrangler dev` to start a local instance of the API.
2. Open `http://localhost:8787/` 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.