diff --git a/internal/server/handlers.go b/internal/server/handlers.go index b69f192..4464153 100644 --- a/internal/server/handlers.go +++ b/internal/server/handlers.go @@ -87,10 +87,16 @@ func (s *Server) handleHealthCheck() http.HandlerFunc { } } -// handleRoot returns a handler that redirects to /status. -func (s *Server) handleRoot() http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, "/status", http.StatusSeeOther) +// handleIndex returns a handler that serves the home page. +func (s *Server) handleIndex() http.HandlerFunc { + return func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "text/html; charset=utf-8") + + tmpl := templates.IndexTemplate() + if err := tmpl.Execute(w, nil); err != nil { + s.logger.Error("Failed to render index template", "error", err) + http.Error(w, "Internal Server Error", http.StatusInternalServerError) + } } } diff --git a/internal/server/routes.go b/internal/server/routes.go index a5e37a7..fceab5c 100644 --- a/internal/server/routes.go +++ b/internal/server/routes.go @@ -21,7 +21,7 @@ func (s *Server) setupRoutes() { r.Use(JSONResponseMiddleware) // Routes - r.Get("/", s.handleRoot()) + r.Get("/", s.handleIndex()) r.Get("/status", s.handleStatusHTML()) r.Get("/status.json", JSONValidationMiddleware(s.handleStatusJSON()).ServeHTTP) r.Get("/.well-known/healthcheck.json", JSONValidationMiddleware(s.handleHealthCheck()).ServeHTTP) diff --git a/internal/templates/as_detail.html b/internal/templates/as_detail.html index 15ade24..acc9099 100644 --- a/internal/templates/as_detail.html +++ b/internal/templates/as_detail.html @@ -5,13 +5,74 @@