Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/oak/middleware/serve.ts>RouteContext

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Very Popular
Latest
class RouteContext
extends ServeContext<S>
import { RouteContext } from "https://deno.land/x/oak@v17.1.2/middleware/serve.ts";

The context associated with serve middleware requests on a router.

Constructors

new
RouteContext(context: RouterContext<R, P, S>)

Type Parameters

R extends string
optional
P extends RouteParams<R> = RouteParams<R>
optional
S extends State = State

Properties

readonly
captures: string[]

When matching the route, an array of the capturing groups from the regular expression.

readonly
matched: Layer<R, P, S>[] | undefined

The routes that were matched for this request.

readonly
params: P

Any parameters parsed from the route when matched.

readonly
routeName: string | undefined

If the matched route has a name, the matched route name is provided here.

readonly
router: Router<S>

A reference to the router instance.

readonly
routerPath: string | undefined

Overrides the matched path for future route middleware, when a routerPath option is not defined on the Router options.

Methods

[Symbol.for("Deno.customInspect")](inspect: (value: unknown) => string): string
[Symbol.for("nodejs.util.inspect.custom")](
depth: number,
options: any,
inspect: (value: unknown, options?: unknown) => string,
): any