add initial application structure with configuration, logging, and health check endpoints
This commit is contained in:
22
internal/controller/health_controller.go
Normal file
22
internal/controller/health_controller.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"epic-ent/internal/service"
|
||||
)
|
||||
|
||||
type HealthController struct {
|
||||
svc *service.HealthService
|
||||
}
|
||||
|
||||
func NewHealthController(svc *service.HealthService) *HealthController {
|
||||
return &HealthController{svc: svc}
|
||||
}
|
||||
|
||||
func (h *HealthController) Health(c echo.Context) error {
|
||||
status := h.svc.Check()
|
||||
return c.JSON(http.StatusOK, status)
|
||||
}
|
||||
Reference in New Issue
Block a user