UNPKG

@upv/ushi-shared

Version:

Shared DTOs, types, and utilities for the USHI platform (LMS, Trials, Social, Wallet).

18 lines (17 loc) 581 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildResponse = void 0; const headers_1 = require("../headers"); /** * Builds a standard API Gateway response with consistent headers. * * @param body - The response body object to serialize. * @param statusCode - HTTP status code (e.g., 200, 404). * @returns Formatted APIGatewayProxyResultV2 response. */ const buildResponse = (body, statusCode = 200) => ({ statusCode, headers: headers_1.defaultHeaders, body: JSON.stringify(body), }); exports.buildResponse = buildResponse;