forked from mtusi2026/mtusi2026lab2
Перенесена ЛР1
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user