health checks
This commit is contained in:
parent
e44e8139c8
commit
6a4b32845d
3 changed files with 32 additions and 0 deletions
23
app.json
Normal file
23
app.json
Normal 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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue