feat(server): public GET /health endpoint for uptime monitors
Returns 200 with {status: ok, version, db: ok} when SQLite is reachable,
503 when the DB probe fails. Unauthenticated so external monitors can
poll without credentials.
This commit is contained in:
parent
3ce2940094
commit
579d7fc6e8
3 changed files with 52 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
defmodule ServerWeb.HealthControllerTest do
|
||||
use ServerWeb.ConnCase, async: true
|
||||
|
||||
test "GET /health returns 200 with status=ok", %{conn: conn} do
|
||||
conn = get(conn, ~p"/health")
|
||||
body = json_response(conn, 200)
|
||||
assert body["status"] == "ok"
|
||||
assert body["db"] == "ok"
|
||||
assert is_binary(body["version"])
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue