CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/express-error-handling

Production error handling for Express APIs — error middleware, async wrappers,

89

2.02x
Quality

86%

Does it follow best practices?

Impact

97%

2.02x

Average score across 4 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-1/

Build a Bookstore Inventory API

Problem/Feature Description

A small online bookstore needs a REST API to manage its inventory. Build it using Express and TypeScript.

Endpoints:

  • GET /api/books -- list all books
  • GET /api/books/:id -- get a single book by ID
  • POST /api/books -- create a new book (fields: title, author, isbn, price)
  • PUT /api/books/:id -- update a book
  • DELETE /api/books/:id -- delete a book

Business rules:

  • ISBN must be unique across all books
  • Price must be a positive number
  • Title and author are required non-empty strings

Use in-memory storage (no real database needed).

Output Specification

Produce:

  • src/server.ts -- server entry point
  • src/app.ts -- Express application setup
  • src/routes/books.ts -- route handlers for book CRUD
  • package.json -- with dependencies listed (no need to run npm install)

You may create additional files as needed for a well-structured codebase.

evals

scenario-1

criteria.json

task.md

tile.json