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 a restaurant chain's mobile app. The app displays the menu, lets customers view item details and nutrition info, and lets authenticated users view their order history and saved favorites.
Produce a self-contained server.js (or server.ts) file with an Express app that:
GET /api/menu route that returns all menu categories with items.GET /api/menu/:itemId route that returns details for a single menu item including nutrition info.GET /api/locations route that returns restaurant locations.GET /api/me/orders route (behind auth middleware) that returns the authenticated user's order history.GET /api/me/favorites route (behind auth middleware) that returns the user's saved favorite items.POST /api/orders route (behind auth middleware) that places a new order.The code should be production-ready for a popular restaurant chain with millions of daily app users.