From 50dc9fca16f8853b0844f625437d0b8944ffb156 Mon Sep 17 00:00:00 2001 From: Karan Sharma Date: Wed, 2 Jun 2021 20:07:13 +0530 Subject: [PATCH] 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 --- cmd/handlers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/handlers.go b/cmd/handlers.go index 1825084..368ccd5 100644 --- a/cmd/handlers.go +++ b/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.