diff options
Diffstat (limited to '')
-rw-r--r-- | pkg/webui/index.go | 12 |
1 files changed, 6 insertions, 6 deletions
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")) + } }) } |