Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Thesephi/oak-routing-ctrl-cloudflare-worker

Template to develop a Cloudflare Workers app
https://github.com/Thesephi/oak-routing-ctrl-cloudflare-worker

api cloudflare-workers oak oak-routing-ctrl scaffold

Last synced: about 12 hours ago
JSON representation

Template to develop a Cloudflare Workers app

Awesome Lists containing this project

README

        

# oak-routing-ctrl-cloudflare-worker

Starter template to develop a Cloudflare Worker application with `@oak/oak` and `@dklab/oak-routing-ctrl`.

Read more:
- [Oakserver](https://oakserver.org/)
- [oak-routing-ctrl](https://jsr.io/@dklab/oak-routing-ctrl)
- [Cloudflare Workers](https://workers.cloudflare.com/)

# How to use this template

This template contains only a minimal set of files needed to develop & deploy a Cloudflare Workers application. You're welcome to use it in whichever way you like, e.g. copying all the
files, or selected files to mix & match as per your project needs.

**Pro-tip**: the fastest way to clone this template to your local machine is to execute:
```bash
npm create oak-cloudflare-worker@latest
```

# Example Deployment

A deployment is available for demo at the following URL: https://oak-routing-ctrl-cloudflare.dklab.workers.dev/swagger

```bash
curl \
-H"x-foo: lorem" \
-H"x-bar: ipsum" \
-H"Content-Type: application/json" \
https://oak-routing-ctrl-cloudflare.dklab.workers.dev/echo/world\?name=dolor -d'{"raz":"maz"}'
```
```
# output
{"query":{"name":"dolor"},"body":{"raz":"maz"},"param":{"name":"world"}}
```

Please keep in mind that there's no uptime guarantee for the deployment above, so it might be unavailable from time to time due to exceeding traffic allowances.