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-2/

Product Catalog API for an E-Commerce Store

Problem Description

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.

Output Specification

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

  1. Has a GET /api/products route that returns a paginated list of products (support ?page=1&limit=20).
  2. Has a GET /api/products/:id route that returns a single product by ID.
  3. Has a GET /api/categories route that returns all product categories.
  4. Has a GET /api/me route (behind auth middleware) that returns the current user's profile.
  5. Has a POST /api/admin/products route (behind auth middleware) that creates a new product.
  6. Stores data in memory (arrays or Maps are fine).
  7. Returns JSON responses with appropriate HTTP status codes.
  8. Listens on port 3000.

The code should be production-ready and follow best practices for a high-traffic public storefront.

evals

tile.json