feat(server): /api/info aggregator + frontend version footer (#40)
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m48s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped

Co-authored-by: Gabriel Radureau <arcodange@gmail.com>
Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
This commit was merged in pull request #40.
This commit is contained in:
2026-05-05 08:29:26 +02:00
committed by arcodange
parent 4a3f1bb138
commit a2beadc458
16 changed files with 587 additions and 1 deletions

View File

@@ -19,6 +19,22 @@ Reference document for all HTTP endpoints exposed by `dance-lessons-coach` serve
| GET | `/api/healthz` | **Kubernetes-style** rich health: status / version / uptime_seconds / timestamp | PR #20 — handler with swag `@Router /healthz [get]` |
| GET | `/api/ready` | Readiness check (DB connection + service deps) | `pkg/server/server.go handleReadiness` |
| GET | `/api/version` | Version info (cached 60s, since PR #29) | `pkg/server/server.go handleVersion` |
| GET | `/api/info` | **Composite info aggregator**: version / commit_short / build_date / uptime_seconds / cache_enabled / healthz_status. Cached when cache is enabled (X-Cache: HIT/MISS header) | ADR-0026 — `pkg/server/server.go handleInfo` |
`/api/info` body schema (`InfoResponse`):
```json
{
"version": "1.0.0",
"commit_short": "abc12345",
"build_date": "2026-05-05",
"uptime_seconds": 1234,
"cache_enabled": true,
"healthz_status": "healthy"
}
```
Use `/api/info` from a frontend footer or status page when you need version + uptime + cache state in a single round trip. The composite design avoids 3-4 chatty calls (`/version`, `/healthz`, `/ready`) when only a snapshot is needed.
`/api/healthz` body schema (`HealthzResponse`):