Task 1 Node.js: Orders API
1. Download the project
The project contains a partially implemented Express API. Your task is to complete the missing endpoints in src/routes/orders.js.
2. Run locally
unzip orders-api.zip
cd orders-api
npm install
npm start # http://localhost:3000
npm test # goal: 5/5 passing
3. What to implement
Open src/routes/orders.js — all TODO comments are there. Do not change any other files.
POST /ordersCreate order → return 201
PUT /orders/:idUpdate status → 200 or 400
GET /orders?status=Fix broken filter → 200 or 400
When done: send src/routes/orders.js + screenshot of
npm test showing 5/5 tests passing to hiring@swiftbuildplatform.art
Task 2 JavaScript: Order Filter Component
Add your filter input below. Implement the filtering logic in the
<script> block at the bottom of this page. The input must have data-testid="order-filter".
| # | Customer | Product | Qty | Unit Price | Total | Status | Date |
|---|---|---|---|---|---|---|---|
| 1001 | John Smith | MacBook Pro 14" | 1 | $1,999 | $1,999 | Completed | 2024-01-15 |
| 1002 | Anna Johnson | iPhone 15 Pro | 2 | $999 | $1,998 | Pending | 2024-01-16 |
| 1003 | Mike Brown | Sony WH-1000XM5 | 1 | $349 | $349 | Cancelled | 2024-01-16 |
| 1004 | Sarah Davis | iPad Air 5 | 1 | $749 | $749 | Completed | 2024-01-17 |
| 1005 | Tom Wilson | Dell XPS 15 | 1 | $1,299 | $1,299 | Pending | 2024-01-17 |
| 1006 | Lisa Chen | Samsung Galaxy S24 | 3 | $899 | $2,697 | Completed | 2024-01-18 |
| 1007 | James Lee | Apple Watch S9 | 2 | $399 | $798 | Cancelled | 2024-01-18 |
| 1008 | Emma White | Bose QuietComfort 45 | 1 | $279 | $279 | Pending | 2024-01-19 |