The video for this lesson is currently being updated, please read the transcript instead.

Body parser middleware

In Express, middleware is a function that can transform your request or response objects.

You can create your own middleware, or use some of the many open source middleware available through NPM.

Body parser middleware

Why I bring this up, is that by default, the body of a POST request in Node.js comes in as a stream.

To put the body data in the database, we need to handle the stream and turn it into a simple JavaScript object.

To view the complete lesson you'll need to login or join this course.


Click to load comments...