MCPcopy Create free account
hub / github.com/Alphanimble/htmlstream / readBody

Function readBody

demo/server/openrouter-chat.ts:46–55  ·  view source on GitHub ↗
(req: IncomingMessage)

Source from the content-addressed store, hash-verified

44}
45
46function readBody(req: IncomingMessage): Promise<string> {
47 return new Promise((resolve, reject) => {
48 let data = "";
49 req.on("data", (chunk) => {
50 data += chunk;
51 });
52 req.on("end", () => resolve(data));
53 req.on("error", reject);
54 });
55}
56
57export type StreamPartKind = "reasoning" | "content";
58

Callers 1

configureServerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected