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

x/oak_http_proxy/test/deps.ts>Oak.MiddlewareObject

Proxy middleware for Deno Oak HTTP servers. 🐿 🦕
Latest
interface Oak.MiddlewareObject
import { type Oak } from "https://deno.land/x/oak_http_proxy@2.3.0/test/deps.ts";
const { MiddlewareObject } = Oak;

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.