From 09885ef1e4b7610d05377596f02d08c5079c0434 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 22 Jan 2025 00:46:49 +0100 Subject: feat(webui): implement states list --- pkg/webui/index.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pkg/webui/index.go') diff --git a/pkg/webui/index.go b/pkg/webui/index.go index 9c81729..3a52fc1 100644 --- a/pkg/webui/index.go +++ b/pkg/webui/index.go @@ -1,16 +1,16 @@ package webui import ( - "html/template" + "fmt" "net/http" ) -var indexTemplates = template.Must(template.ParseFS(htmlFS, "html/base.html", "html/index.html")) - func handleIndexGET() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "no-store, no-cache") - - render(w, indexTemplates, http.StatusOK, nil) + if r.URL.Path == "/" { + http.Redirect(w, r, "/states", http.StatusFound) + } else { + errorResponse(w, http.StatusNotFound, fmt.Errorf("Page not found")) + } }) } -- cgit v1.2.3