forked from mtusi2026/mtusi2026lab2
21 lines
750 B
Go
21 lines
750 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"mtusi2026lab2/internal/transport/http/middleware"
|
|
"mtusi2026lab2/internal/transport/http/response"
|
|
)
|
|
|
|
// HealthLive проверяет, что процесс сервера запущен
|
|
func (h *Handler) HealthLive(w http.ResponseWriter, r *http.Request) {
|
|
reqID := middleware.GetRequestID(r.Context())
|
|
response.WriteJSON(w, http.StatusOK, map[string]string{"status": "ok"}, reqID)
|
|
}
|
|
|
|
// HealthReady проверяет, что сервер готов принимать входящие запросы
|
|
func (h *Handler) HealthReady(w http.ResponseWriter, r *http.Request) {
|
|
reqID := middleware.GetRequestID(r.Context())
|
|
response.WriteJSON(w, http.StatusOK, map[string]string{"status": "ok"}, reqID)
|
|
}
|