MCPcopy Create free account
hub / github.com/TanStack/query / writeBuffer

Function writeBuffer

examples/lit/ssr/server/index.mjs:101–109  ·  view source on GitHub ↗
(res, statusCode, contentType, payload, extraHeaders = {})

Source from the content-addressed store, hash-verified

99}
100
101function writeBuffer(res, statusCode, contentType, payload, extraHeaders = {}) {
102 res.writeHead(statusCode, {
103 'cache-control': 'no-store',
104 'content-length': payload.byteLength,
105 'content-type': contentType,
106 ...extraHeaders,
107 })
108 res.end(payload)
109}
110
111function writeHtml(res, statusCode, body, extraHeaders = {}) {
112 const payload = Buffer.from(body)

Callers 3

writeHtmlFunction · 0.85
writeJsonFunction · 0.85
serveAssetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected