HTTP caching for web APIs — Cache-Control headers, ETags, conditional requests,
88
84%
Does it follow best practices?
Impact
100%
25.00xAverage score across 4 eval scenarios
Passed
No known issues
Build the backend API for an e-commerce store's product catalog. The store has thousands of products organized into categories. Customers browse products, view details, and search. Admin users can add and update products.
Produce a self-contained server.js (or server.ts) file with an Express app that:
GET /api/products route that returns a paginated list of products (support ?page=1&limit=20).GET /api/products/:id route that returns a single product by ID.GET /api/categories route that returns all product categories.GET /api/me route (behind auth middleware) that returns the current user's profile.POST /api/admin/products route (behind auth middleware) that creates a new product.The code should be production-ready and follow best practices for a high-traffic public storefront.