🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.req.query.id
  2. B.req.params.id
  3. C.req.body.id
  4. 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 →