← All topics
Quiz: Node, Express and REST: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. In Express, how do you read 7 from the route /api/courses/:id when the URL is /api/courses/7?
- Q2. Which status code fits "a new resource was created"?
- Q3. What must a middleware call to pass control to the next handler?
- Q4. Which URL design follows REST conventions?
- Q5. Why should database credentials be in environment variables?
- Q6. For the URL /api/courses?maxPrice=1000, how does Express read 1000?
- Q7. What must you add so that req.body contains the parsed JSON sent by a client?
- Q8. A client asks for course 999, which does not exist. Which status code should the API return?
- Q9. Which is a REST-style route for deleting course 7?
- Q10. Why should SQL queries use parameters instead of joining strings with user input?