x/oak/middleware.ts

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Very Popular
Latest
interface MiddlewareObject
import { type MiddlewareObject } from "https://dotland-vbqsvsrpfncg.deno-staging.dev/x/oak@v17.1.2/middleware.ts?s=MiddlewareObject";

Middleware objects allow encapsulation of middleware along with the ability to initialize the middleware upon listen.

Type Parameters

optional
S extends State = Record<string, any>
[src]
optional
T extends Context<S> = Context<S>
[src]

Properties

optional
init: () => Promise<unknown> | unknown
[src]

Optional function for delayed initialization which will be called when the application starts listening.

Methods

handleRequest(context: T, next: Next): Promise<unknown> | unknown[src]

The method to be called to handle the request.