Реализовать lab3 на оценку 4: балансировка и отказ API

This commit is contained in:
Daria0w0
2026-10-23 17:14:32 +03:00
parent 0ab3a341aa
commit a67e7996ec
88 changed files with 5105 additions and 21 deletions
+23
View File
@@ -0,0 +1,23 @@
package httpapi
import "net/http"
func handleHealth(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
w.Header().Set("Allow", http.MethodGet)
writeError(
w,
http.StatusMethodNotAllowed,
"invalid_request",
"Method not allowed",
)
return
}
writeJSON(w, http.StatusOK, struct {
Status string `json:"status"`
}{
Status: "ok",
})
}