Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/workers_middleware/index.ts>provides

Placeholder for Worker-based middleware solution
Latest
function provides
import { provides } from "https://deno.land/x/workers_middleware@v0.1.0-pre.36/index.ts";

Performs content negotiation over the content type of the response.

Type Parameters

T extends string
TS extends readonly T[]

Parameters

types: TS

The content types provided by this endpoint.

Returns

<X extends Context>(ax: Awaitable<X>) => Promise<X & ContentType<TS[number]>>