feat: add /api/health readiness endpoint (#47) - #61
Conversation
|
Review of PR #61 at 🔴 BlockingNone. 🟡 Warning #1 —
|
Add an unauthenticated GET /api/health that reports whether the server is usable, not just listening. Returns "setup_required" until both the admin account and provider config exist, then "ready". - memayu-api: new health module (dto + service) reading the users and provider_config tables; DB errors resolve conservative to setup_required. - memayu-api: register /api/health on the full router outside auth and rate limiting. - memayu-web: register /api/health on the setup-only boot router so a fresh unconfigured instance is still healthcheckable. - Dockerfile: set MEMAYU_PORT=8080 to match EXPOSE 8080, and add g++ (libsql-ffi needs a C++ compiler) so the image builds. - README: document the endpoint as the Docker/systemd healthcheck target with example HEALTHCHECK and ExecStartPost snippets. - Tests: 4 service unit tests, 3 API integration tests, and a setup-only router test covering every state transition.
d561773 to
e0124a5
Compare
Replace dtolnay/rust-toolchain@stable and the rust-toolchain.toml stable channel with an explicit 1.97.1 pin so CI and release builds are reproducible across future stable releases. 1.97.1 is the version verified locally (fmt, clippy, test all pass).
Add an unauthenticated GET /api/health that reports whether the server is usable, not just listening. Returns "setup_required" until both the admin account and provider config exist, then "ready".