From a4f4ca464c610b40a5f9a07163acfdc21543af3a Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Tue, 16 Jul 2024 23:30:53 +0700 Subject: [PATCH] healthz --- cmd/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/main.go b/cmd/main.go index f55b8df..59e47b7 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/gin-gonic/gin" "github.com/isd-sgcu/rpkm67-gateway/config" "github.com/isd-sgcu/rpkm67-gateway/constant" auth "github.com/isd-sgcu/rpkm67-gateway/internal/auth" @@ -183,6 +184,10 @@ func main() { r.GET("/metrics", metricsHdr.ExposeMetrics) + r.GET("/healthz", func(c *gin.Context) { + c.JSON(200, gin.H{"status": "ok"}) + }) + if conf.App.IsDevelopment() { dbConn, err := db.InitDatabase(&conf.Db, conf.App.IsDevelopment()) if err != nil {