Skip to main content
This release is 6 versions behind 17.1.3 — the latest version of @oak/oak. Jump to latest

@oak/oak@16.0.0
Built and signed on GitHub Actions

A middleware framework for handling HTTP with Deno, Node.js, Bun and Cloudflare Workers 🐿️🦕🥟⚙️

This package works with Cloudflare Workers, Node.js, Deno, Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
8 months ago (16.0.0)
class RouteContext
extends ServeContext<S>

The context associated with serve middleware requests on a router.

Constructors

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

Type Parameters

R extends string
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

Add Package

deno add jsr:@oak/oak

Import symbol

import { RouteContext } from "@oak/oak";

---- OR ----

Import directly with a jsr specifier

import { RouteContext } from "jsr:@oak/oak";

Add Package

npx jsr add @oak/oak

Import symbol

import { RouteContext } from "@oak/oak";

Add Package

yarn dlx jsr add @oak/oak

Import symbol

import { RouteContext } from "@oak/oak";

Add Package

pnpm dlx jsr add @oak/oak

Import symbol

import { RouteContext } from "@oak/oak";

Add Package

bunx jsr add @oak/oak

Import symbol

import { RouteContext } from "@oak/oak";