feat: health check

This commit is contained in:
2025-06-17 19:56:43 +03:00
parent 8258ac0ad4
commit 0b03c6ad90
3 changed files with 27 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ import (
"easywish/config"
"easywish/internal/logger"
"easywish/internal/controllers/serviceController"
)
func main() {
@@ -14,16 +15,10 @@ func main() {
panic(err)
}
// Setup logger
defer logger.Sync()
// Connect & migrate database
// models.Init()
// Setup routes
r := gin.Default()
// serviceController.SetupRoutes(r)
// animalController.SetupRoutes(r)
serviceController.SetupRoutes(r)
r.Run()
}

View File

@@ -0,0 +1,11 @@
package serviceController
import (
"net/http"
"github.com/gin-gonic/gin"
)
func HealthCheck(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"status": "ok"})
}

View File

@@ -0,0 +1,14 @@
package serviceController
import (
"github.com/gin-gonic/gin"
)
func SetupRoutes(r *gin.Engine) *gin.Engine {
serviceGroup := r.Group("/service")
serviceGroup.GET("/health", HealthCheck)
return r
}