Files
tp/main_dc/yalarba/api_es/internal/handler/health.go
T
valitovgaziz e436647091 modified: main_dc/docker-compose.yml
modified:   main_dc/yalarba/api_es/internal/handler/all_handlers.go
	new file:   main_dc/yalarba/api_es/internal/handler/health.go
	modified:   main_dc/yalarba/api_es/internal/router/router.go
	new file:   main_dc/yalarba/api_es/internal/utils/formatTime.go
	new file:   main_dc/yalarba/api_es/internal/utils/response.go
	new file:   main_dc/yalarba/api_es/internal/utils/utils.go
	new file:   main_dc/yalarba/api_es/internal/utils/validation.go
add utils and health check heandlers into routes
2025-11-12 13:15:20 +05:00

31 lines
650 B
Go

package handler
import (
"net/http"
"api_es/internal/utils"
)
type HealthHandler struct{}
func NewHealthHandler() *HealthHandler {
return &HealthHandler{}
}
func (h *HealthHandler) HealthCheck(w http.ResponseWriter, r *http.Request) {
response := map[string]string{
"status": "ok",
"message": "Service is healthy",
}
utils.RespondWithJSON(w, http.StatusOK, response)
}
func (h *HealthHandler) Check(w http.ResponseWriter, r *http.Request) {
response := map[string]string{
"status": "ok",
"message": "API is working",
}
utils.RespondWithJSON(w, http.StatusOK, response)
}