Demo: a static copy of one review, without the review service. Reviewed marks apply in this tab until it reloads, and view settings stay in this browser. Comments, decisions, and publication need an installed mcp-review. About mcp-review · Get early access

Move the storefront API to typed handlers

Coverage

Presentation
All 1051 selected changes are placed. 1050 in groups · 0 unbucketed · 1 generated · 0 without a text diff
Explanations
8 of 8 groups have an explanation.
Agent analysis
Reading the analysis status…
Human review
0 of 1051 hunks are marked reviewed.

Typed request pipeline

The pipeline is the reason for this change. A handler now declares its method, path, access and schemas, and runHandler does the rest in a fixed order.

Order of the checks

  1. Access: a user or admin endpoint without a session answers 401, and a non-admin on an admin endpoint 403.
  2. Validation: the path, the query and the body each pass their schema, or the answer is 422 with the problems.
  3. The handler runs. An HttpError becomes its status and code; any other error becomes a 500 that quotes the request ID.

What to check

  • readJson caps the body at 1 MiB and answers 413 above it.
  • A 204 answer writes no body.
  • app.ts keeps listen, so the deployment does not change.
  • src/handlers/index.ts replaces the Express route table and lists each literal path before the path with a parameter.
docs/handlers.md
+23 -0

The changes load when the file comes near.

src/app.ts
+16 -11

The changes load when the file comes near.

src/routes.ts
+0 -453

The changes load when the file comes near.

src/handlers/index.ts
+452 -0

The changes load when the file comes near.

src/http/errors.ts
+23 -0

The changes load when the file comes near.

src/http/handler.ts
+26 -0

The changes load when the file comes near.

src/http/json.ts
+30 -0

The changes load when the file comes near.

src/http/pipeline.ts
+48 -0

The changes load when the file comes near.

src/http/router.ts
+25 -0

The changes load when the file comes near.

+14,668 -11,128 left