Skip to main content
Module

x/cav/mod.ts>endpointResponse

A server framework for Deno
Go to Latest
function endpointResponse
Re-export
import { endpointResponse } from "https://deno.land/x/cav@0.0.21/mod.ts";

Creates an EndpointResponse from the provided body, which is serialized using the top-level serializeBody function. If the provided body is already a Response object, it will be returned with the init headers applied (if there are any). In that case, the status and statusText init options will be ignored. Extra serializers can be used to extend the data types that can be serialized.

Type Parameters

optional
T = unknown

Returns

EndpointResponse<T extends EndpointResponse<infer T2> ? T2 : T extends Response ? unknown : T>