23 lines
468 B
Go
23 lines
468 B
Go
package handlers
|
|
|
|
import (
|
|
"daemonService/internal/controllers"
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
type HealthHandler struct{}
|
|
|
|
func NewHealthHandler() *HealthHandler {
|
|
return &HealthHandler{}
|
|
}
|
|
|
|
func (h *HealthHandler) Check(w http.ResponseWriter, r *http.Request) {
|
|
healthData := map[string]interface{}{
|
|
"status": "healthy",
|
|
"timestamp": time.Now().Format(time.RFC3339),
|
|
}
|
|
|
|
controllers.RespondWithSuccess(w, http.StatusOK, "El servicio está activo.", healthData)
|
|
}
|