From f30c9f263f880efa0599a0b6a8f331cfbd910155 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 11 Dec 2022 17:32:43 +0200 Subject: [PATCH] removed comment and applied linter --- apis/base.go | 2 +- apis/health.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apis/base.go b/apis/base.go index 4ae4620a..7b9b1a4b 100644 --- a/apis/base.go +++ b/apis/base.go @@ -100,7 +100,7 @@ func InitApi(app core.App) (*echo.Echo, error) { bindFileApi(app, api) bindRealtimeApi(app, api) bindLogsApi(app, api) - bindHealthApi(app, api) // health check should always be initialized after everything else is done + bindHealthApi(app, api) // trigger the custom BeforeServe hook for the created api router // allowing users to further adjust its options or register new routes diff --git a/apis/health.go b/apis/health.go index 9a1520f7..ab1df6fd 100644 --- a/apis/health.go +++ b/apis/health.go @@ -1,9 +1,10 @@ package apis import ( + "net/http" + "github.com/labstack/echo/v5" "github.com/pocketbase/pocketbase/core" - "net/http" ) // bindHealthApi registers the health api endpoint. @@ -24,5 +25,6 @@ func (api *healthApi) healthCheck(c echo.Context) error { "code": http.StatusOK, "message": "API is healthy.", } + return c.JSON(http.StatusOK, payload) }