Skip to content

Commit

Permalink
Add content-type parser to Fastify (#8039)
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <[email protected]>
  • Loading branch information
mcollina authored Dec 11, 2024
1 parent 1fc1072 commit a0310ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions javascript/fastify/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ app.get('/user/:id', function (request, reply) {
reply.send(request.params.id);
});

app.addContentTypeParser('application/x-www-form-urlencoded', function (req, body, done) {
// The incoming request in the benchmark is empty anyway
done();
});

app.post('/user', function (request, reply) {
reply.send();
});
Expand Down

0 comments on commit a0310ea

Please sign in to comment.