Skip to main content
Module

x/cav/mod.ts>RouterContext

A server framework for Deno
Go to Latest
interface RouterContext
import { type RouterContext } from "https://deno.land/x/cav@0.2.0-alpha.7/mod.ts";

Metadata object for caching and tracking information about how a Request has been routed so far in the handling process.

Properties

url: URL

new URL(req.url)

path: string

The current, unrouted portion of the requested path.

query: Record<string, string | string[]>

The raw query string parameters, as an object.

param: Record<string, string>

The path parameters captured during the routing process so far.

redirect: Response | null

If this isn't null, this Response should be returned as soon as possible in the routing process. It means the path requested wasn't canonical, and this 302 Response will redirect the client to the canonical URL instead.