health checks

This commit is contained in:
Graham McIntire 2025-06-15 14:55:05 -05:00
parent e44e8139c8
commit 6a4b32845d
3 changed files with 32 additions and 0 deletions

23
app.json Normal file
View file

@ -0,0 +1,23 @@
{
"name": "aprs.me",
"description": "APRS web service",
"scripts": {
"dokku": {
"predeploy": "",
"postdeploy": ""
}
},
"checks": {
"web": [
{
"type": "http",
"name": "web-health",
"path": "/health",
"attempts": 3,
"timeout": 5,
"wait": 10,
"initial_delay": 10
}
]
}
}

View file

@ -12,4 +12,8 @@ defmodule AprsWeb.PageController do
def packets(conn, _params) do
render(conn, :packets)
end
def health(conn, _params) do
json(conn, %{status: "ok", version: Application.spec(:aprs, :vsn)})
end
end

View file

@ -17,6 +17,11 @@ defmodule AprsWeb.Router do
plug :accepts, ["json"]
end
scope "/", AprsWeb do
pipe_through :api
get "/health", PageController, :health
end
scope "/", AprsWeb do
pipe_through :browser