DashboardopencodeHttpApiBuilder thin handlers

HttpApiBuilder thin handlers

Category: preference
Confidence: 1.00
ID: 01a0a5c1-2720-78c5-b40a-a454d47369ca
Project ID: c0425955-02bc-4c17-9af2-b114c00077e7
Cross-project: No
Recalled in other projects: 0
Source session: 1JyMljb40jX8CuggV
Created: 2026-09-14 09:33:25
Updated: 2026-09-15 15:48:14

Content

Always implement declared endpoints, including SSE, with HttpApiBuilder.group(...). Keep handlers thin: decode input, read request context, call services, and map transport errors; business rules belong in services. Chose stable layers provided once at the application boundary over Effect.provide(...) inside handlers because broad provisioning rebuilds dependencies, hides ownership, and makes tests drift. Reserve HttpRouter.use(...) for routes outside the API contract.

Move to: