CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/api-idempotency

Idempotent API design — safe retries for POST endpoints, idempotency keys,

93

10.00x
Quality

90%

Does it follow best practices?

Impact

100%

10.00x

Average score across 4 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-2/

Checkout Page for an Online Store

Problem Description

Build a simple checkout page for an online store. The page should have a form where the customer enters their name and selects an item, then clicks "Place Order" to submit their order.

The backend should be an Express.js server with a POST /api/orders endpoint that creates a new order in an in-memory array (no database needed) and returns the created order as JSON.

The frontend should be a single HTML file that shows the form and displays a confirmation message when the order is placed successfully.

Output Specification

Produce:

  1. A server.js file with an Express app that:

    • Serves a static HTML file
    • Has a POST /api/orders route that accepts { customerName, item } and returns the created order with an id
    • Listens on port 3000
  2. A public/index.html file with:

    • A form with customer name input, item input, and a "Place Order" button
    • JavaScript that submits the form data to POST /api/orders using fetch
    • Displays a confirmation message on success

evals

tile.json