@sigiljs/sigil
Version:
TypeScript-first Node.js HTTP framework offering schema-driven routing, modifier-based middleware, plugin extensibility, and flexible response templating
12 lines (11 loc) • 554 B
TypeScript
import { SigilOptions } from '../types/common.types';
/**
* Default template for formatting handler responses into HTTP responses.
* Applies JSON error wrapper for exceptions, sets content-type headers,
* and serializes payloads appropriately.
*
* @type {SigilOptions["responseTemplate"]}
* @param payload raw handler response, which may be an Error, SigilResponse, Buffer, or other value.
* @returns object containing `content`, `code`, and `headers` for HTTP response.
*/
export declare const defaultTemplate: SigilOptions["responseTemplate"];