View Source SignificaUtils.HealthRouter (significa_utils v0.0.7)
Simple all-in-one health router (with handlers).
usage
Usage:
In you router, use Phoenix.Router.html.forward/4
to use this router (or match
).
forward "/healthz", SignificaUtils.HealthRouter,
repo: MyProject.Repo,
otp_app: :my_project
It will create 3 routes under the specified prefix (/healthz
in the example above):
/
: ReturnsOK
(we include content as it is sometimes strange to have zero length responses)./db
: Uses ecto and the providedrepo
to return theversion
of the latest Ecto migration./version
: Returns the value of the:app_version
env, specified in yourotp_app
. Make sure you have usedApplication.put_env/3
or defined theapp_version
in your configs:config :my_project, app_version: "1.2.3"