Categories
Node.js Quick Tips Quick Tips

Don’t install body-parser – it’s already bundled with Express

< 1 min read

The body-parser middleware has been bundled with Express since v4.16.0, so there’s no need to install it.

app.use(express.json());

…is all you need to parse JSON request bodies.

code

It’s so easy to end up cargo culting code between applications that you miss what’s been there in the documentation for years!

Thanks to Reddit user anatolhiman for letting me know about this.

Original tweet

Leave a Reply

Your email address will not be published. Required fields are marked *