MCPcopy Create free account
hub / github.com/21st-dev/magic-mcp / parseBody

Method parseBody

src/utils/callback-server.ts:37–47  ·  view source on GitHub ↗
(req: IncomingMessage)

Source from the content-addressed store, hash-verified

35 }
36
37 private parseBody(req: IncomingMessage): Promise<string> {
38 return new Promise((resolve) => {
39 let body = "";
40 req.on("data", (chunk) => {
41 body += chunk.toString();
42 });
43 req.on("end", () => {
44 resolve(body);
45 });
46 });
47 }
48
49 private handleRequest = async (req: IncomingMessage, res: ServerResponse) => {
50 res.setHeader("Access-Control-Allow-Origin", "*");

Callers 1

CallbackServerClass · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected