MCPcopy Create free account
hub / github.com/electric-sql/electric / getRequestBody

Function getRequestBody

examples/tanstack/src/server/app.js:16–23  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

14
15// Async function to handle reading the body of the request
16const getRequestBody = async (req) => {
17 return new Promise((resolve, reject) => {
18 let body = ``
19 req.on(`data`, (chunk) => (body += chunk.toString()))
20 req.on(`end`, () => resolve(body))
21 req.on(`error`, reject)
22 })
23}
24
25const JSON_HEADERS = {
26 "Content-Type": `application/json`,

Callers 1

app.jsFile · 0.85

Calls 3

resolveFunction · 0.85
onMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected