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

Function writeText

apps/memos-local-plugin/server/middleware/io.ts:44–52  ·  view source on GitHub ↗
(
  res: ServerResponse,
  status: number,
  text: string,
  contentType = "text/plain; charset=utf-8",
)

Source from the content-addressed store, hash-verified

42}
43
44export function writeText(
45 res: ServerResponse,
46 status: number,
47 text: string,
48 contentType = "text/plain; charset=utf-8",
49): void {
50 res.writeHead(status, { "content-type": contentType });
51 res.end(text);
52}
53
54export function writeNotFound(res: ServerResponse): void {
55 writeJson(res, 404, { error: { code: "not_found", message: "not found" } });

Callers 1

tryServeFunction · 0.85

Calls 1

endMethod · 0.80

Tested by

no test coverage detected