Skip to content

Commit da90442

Browse files
committed
docs: fastify reads the body for you [skip ci]
1 parent 7a1cceb commit da90442

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,7 @@ fastify.all('/graphql', async (req, res) => {
190190
url: req.url,
191191
method: req.method,
192192
headers: req.headers,
193-
body: await new Promise((resolve) => {
194-
let body = '';
195-
req.on('data', (chunk) => (body += chunk));
196-
req.on('end', () => resolve(body));
197-
}),
193+
body: req.body, // fastify reads the body for you
198194
raw: req,
199195
});
200196
res.writeHead(init.status, init.statusText, init.headers).end(body);

0 commit comments

Comments
 (0)