mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 12:45:47 +00:00
26 lines
550 B
Go
26 lines
550 B
Go
package controller
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
type HealthController struct {
|
|
router *gin.RouterGroup
|
|
}
|
|
|
|
func NewHealthController(router *gin.RouterGroup) *HealthController {
|
|
return &HealthController{
|
|
router: router,
|
|
}
|
|
}
|
|
|
|
func (controller *HealthController) SetupRoutes() {
|
|
controller.router.GET("/healthz", controller.healthHandler)
|
|
controller.router.HEAD("/healthz", controller.healthHandler)
|
|
}
|
|
|
|
func (controller *HealthController) healthHandler(c *gin.Context) {
|
|
c.JSON(200, gin.H{
|
|
"status": "ok",
|
|
"message": "Healthy",
|
|
})
|
|
}
|