The request
Shipment status lookup API with sample data
Read the full request
Build a small Node HTTP JSON API for a logistics team to look up shipment status, using bundled sample data (at least 15 shipments, each with a list of timestamped scan events such as picked up, in transit, out for delivery, delivered). Endpoints: GET /api/shipments lists shipments with their current status; GET /api/shipments/:id/status returns the latest scan for that shipment with its timestamp and location; an unknown id returns 404 with a JSON error. The latest scan is the one with the newest timestamp, whatever order the events are stored in. No external services or database. Include a README documenting how to start the server, the endpoints and example responses.
The journey
- Read the requestTurned it into a list of things it would have to prove before calling the work done.
- Did the workPlanned the pieces, built them and checked the result as it went.
- Delivered12 files handed over.
The result
- dist/index.js336 B
- dist/index.js.map490 B
- dist/server.js1.4 KB
- dist/server.js.map1.9 KB
- dist/shipments.js3.1 KB
- dist/shipments.js.map3.0 KB
- eslint.config.js284 B
- package-lock.json118.2 KB
- package.json556 B
- README.md881 B
- src/index.ts294 B
- src/server.ts1.6 KB