REST API design patterns — response envelopes, pagination, filtering, status codes, and resource naming
87
83%
Does it follow best practices?
Impact
98%
1.78xAverage score across 4 eval scenarios
Passed
No known issues
An online retailer needs a backend API for their customer portal where customers can place and track orders. Each order belongs to a customer and contains one or more line items. Customers should be able to see their own orders and admins should be able to see all orders.
Build a Node.js/Express REST API that supports:
Orders have: id, customer_id, status, shipping_address, total, created_at. Line items have: id, order_id, product_name, quantity, unit_price.
Implement the API in a src/ directory with an entry point at src/app.js (or src/app.ts). Use SQLite or in-memory storage.
Produce a package.json with all dependencies.
Do not start the server — just produce the source files.