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

Function readBody

demo/server/session-log.ts:16–25  ·  view source on GitHub ↗
(req: IncomingMessage)

Source from the content-addressed store, hash-verified

14}
15
16function readBody(req: IncomingMessage): Promise<string> {
17 return new Promise((resolve, reject) => {
18 let data = "";
19 req.on("data", (chunk) => {
20 data += chunk;
21 });
22 req.on("end", () => resolve(data));
23 req.on("error", reject);
24 });
25}
26
27function ensureSessionDir(): void {
28 if (!fs.existsSync(SESSION_DIR)) {

Callers 1

configureServerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected