MCPcopy Create free account
hub / github.com/MemTensor/MemOS / writeJson

Function writeJson

apps/memos-local-plugin/server/middleware/io.ts:34–42  ·  view source on GitHub ↗
(
  res: ServerResponse,
  status: number,
  payload: unknown,
)

Source from the content-addressed store, hash-verified

32}
33
34export function writeJson(
35 res: ServerResponse,
36 status: number,
37 payload: unknown,
38): void {
39 const body = JSON.stringify(payload);
40 res.writeHead(status, { "content-type": "application/json; charset=utf-8" });
41 res.end(body);
42}
43
44export function writeText(
45 res: ServerResponse,

Callers 8

startHttpServerFunction · 0.85
dispatchFunction · 0.85
writeNotFoundFunction · 0.85
writeMethodNotAllowedFunction · 0.85
enforceApiKeyFunction · 0.85
parseJsonFunction · 0.85
writeErrorFunction · 0.85

Calls 1

endMethod · 0.80

Tested by

no test coverage detected