mirror of
				https://github.com/steveiliop56/tinyauth.git
				synced 2025-10-28 04:35:40 +00:00 
			
		
		
		
	 ad4fc7ef5f
			
		
	
	ad4fc7ef5f
	
	
	
		
			
			* refactor: don't export non-needed fields * feat: coderabbit suggestions * fix: avoid queries panic
		
			
				
	
	
		
			26 lines
		
	
	
		
			548 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			548 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)
 | |
| 	controller.router.HEAD("/health", controller.healthHandler)
 | |
| }
 | |
| 
 | |
| func (controller *HealthController) healthHandler(c *gin.Context) {
 | |
| 	c.JSON(200, gin.H{
 | |
| 		"status":  "ok",
 | |
| 		"message": "Healthy",
 | |
| 	})
 | |
| }
 |