chore: add health route
This commit is contained in:
parent
6da1f91c2f
commit
58b86d545e
1 changed files with 3 additions and 0 deletions
|
|
@ -177,6 +177,9 @@ func getRoutes(router *gin.Engine, cfg *cfg.Config, users *UsersAccounts, mdlsUs
|
||||||
file,
|
file,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
router.GET("/v1/health", func(c *gin.Context) {
|
||||||
|
c.JSON(http.StatusOK, gin.H{"status": "ok"})
|
||||||
|
})
|
||||||
if cfg.UseJWT {
|
if cfg.UseJWT {
|
||||||
router.NoRoute(routenv.AuthMiddleware.MiddlewareFunc(), func(c *gin.Context) {
|
router.NoRoute(routenv.AuthMiddleware.MiddlewareFunc(), func(c *gin.Context) {
|
||||||
claims := jwt.ExtractClaims(c)
|
claims := jwt.ExtractClaims(c)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue