Skip to main content
Module

x/oak/middleware.ts>MiddlewareObject

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Extremely Popular
Go to Latest
interface MiddlewareObject
import { type MiddlewareObject } from "https://deno.land/x/oak@v12.5.0/middleware.ts";

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>
optional
T extends Context<S> = Context<S>

Properties

optional
init: () => Promise<unknown> | unknown

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

Methods

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

The method to be called to handle the request.