Skip to main content
Module

x/http_fns/status.ts>byStatus

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

Create a Response Interceptor that matches the status of the Response.

Parameters

status: number | number[]

one or many HTTP status codes to match against the Response

interceptor: (request: Request, response: Response | null) => Awaitable<Response | null | void>

called if the status matches, it should take the Request and Response as arguments, and return a Response, or void/undefined to pass the Response through as is, or null to indicate a skipped response.