npm.io
0.4.0 • Published 3 years ago

@zebp/routy

Licence
MIT
Version
0.4.0
Deps
0
Size
46 kB
Vulns
0
Weekly
0
Stars
1

routy

A simple and extendable Router for Node, Deno, and Cloudflare Workers.

Example

import { WebRouter } from "@zebp/routy";

const router = new WebRouter().get(
  "/greet/:name",
  (_req, _data, ctx) => new Response(`Hello, ${ctx.params.name}!`)
);

const response = await router.route(
  new Request("https://example.com/greet/user")
);