Files
tp/serv_nginx/api_bb/internal/handlers/health.go
T
valitovgaziz ed8f0943c3 modified: serv_nginx/api_bb/internal/handlers/auth.go
modified:   serv_nginx/api_bb/internal/handlers/avatar.go
	modified:   serv_nginx/api_bb/internal/handlers/health.go
	modified:   serv_nginx/api_bb/internal/handlers/user.go
	modified:   serv_nginx/api_bb/internal/routes/routes.go
	deleted:    serv_nginx/bbvue/src/stores/counter.js
	modified:   serv_nginx/bbvue/src/views/Profile.vue
update chi to last, moove the routing from handlers to router.go
2025-10-19 05:26:54 +05:00

31 lines
646 B
Go

package handlers
import (
"net/http"
"api_bb/pkg/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)
}