console: redirect root to console
This commit is contained in:
@@ -104,6 +104,13 @@ func NewServer(cfg Config) *Server {
|
||||
// Разделено на публичные (без auth) и приватные (с authMiddleware).
|
||||
func (s *Server) RegisterRoutes(mux *http.ServeMux) {
|
||||
// Публичные: health checks, UI, auth endpoint
|
||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
http.Redirect(w, r, "/console/", http.StatusTemporaryRedirect)
|
||||
})
|
||||
mux.HandleFunc("/health", func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
||||
_, _ = w.Write([]byte("ok\n"))
|
||||
|
||||
Reference in New Issue
Block a user