Browse Source

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
Karan Sharma 4 years ago
parent
commit
50dc9fca16
1 changed files with 2 additions and 0 deletions
  1. 2 0
      cmd/handlers.go

+ 2 - 0
cmd/handlers.go

@@ -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.