express-hello-world Flashcards

1
Q

How do you mount a middleware with an Express application?

A

The use method registers a middleware with the app like an event listener added to request. app.use(middleware function) The middleware function gets loaded before the route to the root path.

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

The req and res objects for requests and responses made to and from the server based on the interaction with the server from a client.

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