mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-10 14:28:12 +00:00
refactor: simplify middleware, controller and service init
This commit is contained in:
@@ -3,18 +3,15 @@ package controller
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type HealthController struct {
|
||||
router *gin.RouterGroup
|
||||
}
|
||||
|
||||
func NewHealthController(router *gin.RouterGroup) *HealthController {
|
||||
return &HealthController{
|
||||
router: router,
|
||||
}
|
||||
}
|
||||
controller := &HealthController{}
|
||||
|
||||
func (controller *HealthController) SetupRoutes() {
|
||||
controller.router.GET("/healthz", controller.healthHandler)
|
||||
controller.router.HEAD("/healthz", controller.healthHandler)
|
||||
router.GET("/healthz", controller.healthHandler)
|
||||
router.HEAD("/healthz", controller.healthHandler)
|
||||
|
||||
return controller
|
||||
}
|
||||
|
||||
func (controller *HealthController) healthHandler(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user