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

x/workers_middleware/context.ts>withMiddleware

Placeholder for Worker-based middleware solution
Latest
function withMiddleware
Deprecated
Deprecated

Name might change, errorHandler not implemented

import { withMiddleware } from "https://deno.land/x/workers_middleware@v0.1.0-pre.36/context.ts";

Takes a handler function of the form (x: Request, ctx: Context) => Awaitable<Response> and applies middleware to it.

Parameters

middleware: Middleware<Context, X>
handler: Handler<X>
optional
_errorHandler: ErrorHandler<EX>