Back to case studies
Node.jsFundamental

Building a REST API with Express and basic routing

Scenario

Context A backend team needs a simple CRUD API for managing a list of products stored in memory. The Problem All logic is currently in a single index.js file with nested callbacks, making the code hard to read and extend. Constraints Use Express to define GET, POST, PUT, and DELETE routes for /products. Store products in an in-memory array. Return appropriate HTTP status codes for each operation. Expected Deliverable An Express REST API with four CRUD routes for a products resource, using in-memory storage and correct status codes.

Targeted skills

nodejsexpressrest-apicrudrouting
    Building a REST API with Express and basic routing — Node.js hands-on scenario | CodeDuel