Skip to main content
Module

x/oak_sessions/deps.ts>MiddlewareObject

Session middleware for Oak
Latest
interface MiddlewareObject
import { type MiddlewareObject } from "https://deno.land/x/oak_sessions@v4.1.11/deps.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.