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
7 months ago (16.0.0)
interface RouterMiddleware

The interface that Router middleware should adhere to.

Type Parameters

R extends string
S extends State = Record<string, any>

Call Signatures

(
context: RouterContext<R, P, S>,
next: () => Promise<unknown>,
): Promise<unknown> | unknown

Properties

optional
param: keyof P

For route parameter middleware, the param key for this parameter will be set.

optional
router: Router<any>

Add Package

deno add jsr:@oak/oak

Import symbol

import { type RouterMiddleware } from "@oak/oak/router";

---- OR ----

Import directly with a jsr specifier

import { type RouterMiddleware } from "jsr:@oak/oak/router";

Add Package

npx jsr add @oak/oak

Import symbol

import { type RouterMiddleware } from "@oak/oak/router";

Add Package

yarn dlx jsr add @oak/oak

Import symbol

import { type RouterMiddleware } from "@oak/oak/router";

Add Package

pnpm dlx jsr add @oak/oak

Import symbol

import { type RouterMiddleware } from "@oak/oak/router";

Add Package

bunx jsr add @oak/oak

Import symbol

import { type RouterMiddleware } from "@oak/oak/router";