mirror of
				https://github.com/steveiliop56/tinyauth.git
				synced 2025-11-04 08:05:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			487 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			487 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("/health", controller.healthHandler)
 | 
						|
}
 | 
						|
 | 
						|
func (controller *HealthController) healthHandler(c *gin.Context) {
 | 
						|
	c.JSON(200, gin.H{
 | 
						|
		"status":  "ok",
 | 
						|
		"message": "Healthy",
 | 
						|
	})
 | 
						|
}
 |