Appearance
App factory (create_app, middleware, exception handlers, lifecycle)
Applies to: **/presentation/http/app.py
Checklist
create_appis the FastAPI app factory: it accepts injected ports and settings and mounts routers viainclude_routerwith prefix and tags; it contains no route handlers itself.- CORS middleware and settings reads stay here for framework settings (CORS origins, OTEL) with documented defaults; flag any other environment read in this module.
- Long-lived resources connect and close through FastAPI lifespan (or documented startup/shutdown registration); flag
@app.on_eventand clients opened at import time. RequestValidationErrorand domain error handlers are registered here, each translating once to its declared structured payload withstatus_codeand error model.