Script Valley
REST API Development: Complete Course from Beginner to Production
Building REST APIs with Express.js/Assessment

Practice & Assessment

Test your understanding of Building REST APIs with Express.js

Multiple Choice Questions

6
1

What is the purpose of express.json() middleware in an Express application?

2

What is the correct signature for an Express error-handling middleware?

3

In Express.js, what does calling next() inside a middleware do?

4

Which status code should Express return when a Mongoose duplicate key error (code 11000) occurs?

5

What is the benefit of the asyncHandler wrapper utility in Express?

6

What does Supertest allow you to do in API testing?

Mini Project

1

Blog REST API with Full CRUD and Nested Resources

Build a production-structured Blog REST API with User (author), Post, and Comment resources. Implement full CRUD for Posts, nested Comments on Posts, query parameters for filtering by author, tag, and date range, and sorting. Use the scalable project structure, Joi validation, centralized error handling, Morgan logging, environment variables with dotenv, and a minimum 80% test coverage. Include a README with setup instructions and curl examples for every endpoint.

Medium