Skip to main content

apiResponse

apiResponse<TBody>(resData, options?): Response

Creates a generic API response with the specified data and options.

Type Parameters​

TBody​

TBody

Parameters​

resData​

TBody

The response data to be sent to the client as JSON.

options?​

ResponseInit

Response initialization settings, such as headers and status.

Returns​

Response