Express Flashcards

1
Q

How do you mount a middleware with an Express application?

A

functions are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle. App.use

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

Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?

A

res and req objects

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

What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?

A

application/json

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

What is the significance of an HTTP request’s method?

A

A route method is derived from one of the HTTP methods

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