Skip to main content
Module

x/http_fns/intercept.ts>intercept

A bunch of functions for building HTTP servers
Go to Latest
function intercept
import { intercept } from "https://deno.land/x/http_fns@v0.0.27/intercept.ts";

Wrap a Request handler with chains of interceptor functions that modify the request or response, and optionally handle any errors.

Type Parameters

A extends unknown[]
R extends Response | null

Parameters

handler: (req: Request, ...args: A) => R | Promise<R>

the original handler

...interceptors: readonly Interceptors<A, R>[]

Returns

handler

a new Request handler