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
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
3
Q
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
A
application/json
4
Q
What is the significance of an HTTP request’s method?
A
A route method is derived from one of the HTTP methods