mirror of
https://github.com/vcscsvcscs/GenerationsHeritage.git
synced 2025-08-13 22:39:06 +02:00
Add healthcheck endpoint
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/vcscsvcscs/GenerationsHeritage/backend/liveness"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -40,13 +41,11 @@ func main() {
|
||||
gin.DefaultWriter = io.MultiWriter(f)
|
||||
}
|
||||
}
|
||||
|
||||
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
|
||||
log.SetOutput(gin.DefaultErrorWriter)
|
||||
|
||||
hc := liveness.New()
|
||||
|
||||
router := gin.Default()
|
||||
router.GET("/health", func(c *gin.Context) {
|
||||
c.JSON(200, gin.H{
|
||||
"message": "ok",
|
||||
})
|
||||
})
|
||||
router.GET("/health", hc.HealthCheckHandler())
|
||||
}
|
||||
|
Reference in New Issue
Block a user