@cyancy/cf-responder

0.3.4 • Public • Published

cf-responder

Examples

Hello World!

// src/index.ts
import r, {Router} from '@cyancy/cf-responder'
r.init("json") // Use `json` if your target is api
const {it} = r

const router = Router<Request, Parameters<Params<Env>['handle']>>()

router.get('/', (req) => r.respondData("Hello World"))

export interface Env {
  // Your Cloudflare Workers Env typing
}

export default {
  handle: router.handle
}

Readme

Keywords

none

Package Sidebar

Install

npm i @cyancy/cf-responder

Weekly Downloads

0

Version

0.3.4

License

none

Unpacked Size

10.8 kB

Total Files

6

Last publish

Collaborators

  • cyancy