Skip to content

send

send: (options?) => Function

Defined in: http/send.js:114

Creates a response serialization function.

Send configuration

boolean | Function = false

Wrap 2xx Object bodies in a response envelope. false (default) — no envelope. true — built-in format {id, status, data, count?}. function(body, ctx) — custom envelope.

boolean = true

Generate and evaluate ETags for conditional responses

boolean = false

When true, read domainAcc.prefer for RFC 7240 handling. Adds Prefer to the Vary header.

boolean = false

Pretty-print JSON output

string[] = ...

Vary header values to append

Function

  • (req, res, responseAcc, domainAcc) => void