← Quiz: Node, Express and REST: all 10 questions
Quiz: Node, Express and REST · Question 1 of 10
In Express, how do you read 7 from the route /api/courses/:id when the URL is /api/courses/7?
In Express, how do you read 7 from the route /api/courses/:id when the URL is /api/courses/7?
- A.req.query.id
- B.req.params.id
- C.req.body.id
- D.req.id
Answer & explanation
Correct answer: req.params.id
Route parameters are in req.params.
Can you get the rest right without peeking?
Take the timed Quiz: Node, Express and REST quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →