浏览代码

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 年之前
父节点
当前提交
50dc9fca16
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      cmd/handlers.go

+ 2 - 0
cmd/handlers.go

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