Minimal HTTP router library based on the
URLPattern
API.
import { createRouter } from "@fartlabs/rt";
const router = createRouter()
.get("/", () => new Response("Hello, World!"))
.default(() => new Response("Not found", { status: 404 }));
Deno.serve((request) => router.fetch(request));
1. Install Deno.
2. Start a new Deno project.
deno init
3. Add rt as a project dependency.
deno add @fartlabs/rt
We appreciate your help!
Run deno fmt
to format the code.
Run deno lint
to lint the code.
Developed with ❤️ @FartLabs