feat(api): axum skeleton with health and OpenAPI #53
Reference in New Issue
Block a user
Delete Branch "issue/5-axum-skeleton"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #5.
GET /api/healthprobes Prowlarr (/ping), Transmission (an RPC call — a409asking for a session id is a live daemon) and TMDB, concurrently, with a3s timeout each. It always answers
200; the body carriesokordegradedplus a per-upstream verdict, so a degraded service can explain itself instead
of looking like a fourth outage. A missing TMDB key is
unconfigured, not anoutage. Failure details never include the probed URL, which carries the TMDB
key in its query string.
The OpenAPI document is collected from
#[utoipa::path]annotations viautoipa_axum::routes!, so it is generated, not written.routes!does notaccept a handler without the annotation:
Served at
/api/openapi.json, browsable at/api/docs(Scalar).just gen-clientdumps the spec viaarr --openapi(no port, no upstreams)and runs
openapi-typescriptintoweb/src/api/. Output is gitignored —nothing consumes it until #6, and generated files no CI step regenerates go
stale silently.
The
web/probe in the Justfile and CI now keys onweb/package.jsonratherthan the directory, since
gen-clientcreatesweb/before the SPA exists.Verification
just cigreen: fmt, clippy-D warnings, machete, 24 tests.Not verified against the live Prowlarr or Transmission — neither answered from
this machine at the addresses in DESIGN.md §3, so the probe shapes are covered
by wiremock only.
Reviewed
2de7f88e42410a7032a6087b239c93d6dd56c118. No findings.