feat: add a public healthcheck endpoint

- Adds `/health` as a public facing healthcheck endpoint.
- `/api/health` is meant for internal healthchecks. This endpoint in
  future can serve sensitive information about Listmonk *or* can be
deprecated if there's not enough usecase.

Closes https://github.com/knadh/listmonk/issues/380
This commit is contained in:
Karan Sharma 2021-06-02 20:07:13 +05:30
parent 59bcc8eb13
commit 50dc9fca16

View file

@ -151,6 +151,8 @@ func registerHTTPHandlers(e *echo.Echo, app *App) {
"campUUID", "subUUID"))
e.GET("/campaign/:campUUID/:subUUID/px.png", validateUUID(handleRegisterCampaignView,
"campUUID", "subUUID"))
// Public health API endpoint.
e.GET("/health", handleHealthCheck)
}
// handleIndex is the root handler that renders the Javascript frontend.