Skip to main content

castToResponse

Overview

castToResponse

(event, responseLike, reactRenderOptions?): `Promise<Response>`

Infers the appropriate Response constructor for the given ResponseLike body.

While the RequestRouter automatically converts returned values via castToResponse.

Throws

Parameters

NameType
eventIsomorphicFetchEvent<any, any, any>
responseLikeResponseLike
reactRenderOptions?ReactRendererOptions

Returns

Promise<Response>

Defined in

http/functions/castToResponse.ts:40