express-post-json Flashcards

1
Q

What does the express.json() middleware do and when would you need it?

A

it recognizes the incoming request object as a JSON object then attaches it to req.body
you would need it when the client makes a post/put because in both these requests the user is sending data (in the form of some data object) to be accepted or stored by the server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is middleware?

A

middleware is the functions/methods/operations that are called in between a request and a response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly