Skip to main content

@fartlabs/rt@0.0.2

Minimal HTTP router library based on the URLPattern API.

Works with
It is unknown whether this package works with Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Browsers
JSR Score
100%
Published
5 days ago
indexRouterContext
interface RouterContext
deno add @fartlabs/rt
import { type RouterContext } from "@fartlabs/rt";
npx jsr add @fartlabs/rt
import { type RouterContext } from "@fartlabs/rt";
yarn dlx jsr add @fartlabs/rt
import { type RouterContext } from "@fartlabs/rt";
pnpm dlx jsr add @fartlabs/rt
import { type RouterContext } from "@fartlabs/rt";
bunx jsr add @fartlabs/rt
import { type RouterContext } from "@fartlabs/rt";

RouterContext is the object passed to a router.

Type Parameters

T extends string

Properties

request is the original request object.

url is the parsed fully qualified URL of the request.

params: [key in T]: string

params is a map of matched parameters from the URL pattern.

next executes the next matched route in the sequence. If no more routes are matched, the default handler is called.