express-hello-world Flashcards

1
Q

How do you mount a middleware with an Express application?

A

app.use(‘/user/:id’, (req, res, next) => {
console.log(‘Request Type:’, req.method)
next()
})

call the use method, give it the path and a callback

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly