CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/http-caching-strategy

HTTP caching for web APIs — Cache-Control headers, ETags, conditional requests,

88

25.00x
Quality

84%

Does it follow best practices?

Impact

100%

25.00x

Average score across 4 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-3/

Restaurant Menu API

Problem Description

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.

Output Specification

Produce a self-contained server.js (or server.ts) file with an Express app that:

  1. Has a GET /api/menu route that returns all menu categories with items.
  2. Has a GET /api/menu/:itemId route that returns details for a single menu item including nutrition info.
  3. Has a GET /api/locations route that returns restaurant locations.
  4. Has a GET /api/me/orders route (behind auth middleware) that returns the authenticated user's order history.
  5. Has a GET /api/me/favorites route (behind auth middleware) that returns the user's saved favorite items.
  6. Has a POST /api/orders route (behind auth middleware) that places a new order.
  7. Stores data in memory (arrays or Maps are fine).
  8. Returns JSON responses with appropriate HTTP status codes.
  9. Listens on port 3000.

The code should be production-ready for a popular restaurant chain with millions of daily app users.

evals

tile.json