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_projectIt 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 providedrepoto return theversionof the latest Ecto migration./version: Returns the value of the:app_versionenv, specified in yourotp_app. Make sure you have usedApplication.put_env/3or defined theapp_versionin your configs:config :my_project, app_version: "1.2.3"