Macaw.Host.Health.Plug (macaw_host v0.3.0)

Copy Markdown View Source

Serves an app's health report as JSON: 200 when healthy, 503 when not. The JSON is the report's wire form (Macaw.Host.Health.to_wire/1): each check's result worded as text here, at the edge.

get "/healthz", Macaw.Host.Health.Plug, report: {MyApp.Health, :report, []}

or as a plug in an endpoint, answering only its :path (default /healthz) and passing every other request on.