package handler import ( "net/http" "github.com/panelhosting/panel/internal/setup" ) func Health(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte(`{"status":"ok"}`)) } func IndexPage(svc *setup.Service) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { required, err := svc.Status(r.Context()) if err != nil { writeError(w, http.StatusInternalServerError, "internal error") return } index(required)(w, r) } } func index(setupRequired bool) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if setupRequired { w.Header().Set("Content-Type", "text/html; charset=utf-8") w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte(setupPageHTML)) return } writeJSON(w, http.StatusOK, map[string]string{ "name": "PanelHosting", "version": "0.1.0", "status": "running", }) } } const setupPageHTML = ` PanelHosting — первичная настройка

PanelHosting

Создайте учётную запись суперадминистратора

`