summaryrefslogtreecommitdiff
path: root/internal/adminui/ui.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/adminui/ui.go')
-rw-r--r--internal/adminui/ui.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/adminui/ui.go b/internal/adminui/ui.go
index 7f58030..49899ea 100644
--- a/internal/adminui/ui.go
+++ b/internal/adminui/ui.go
@@ -14,5 +14,14 @@ func Handler() http.Handler {
if err != nil {
panic(err)
}
- return http.FileServer(http.FS(content))
+ files := http.FileServer(http.FS(content))
+ mux := http.NewServeMux()
+ mux.HandleFunc("GET /models", func(w http.ResponseWriter, r *http.Request) {
+ http.ServeFileFS(w, r, content, "models.html")
+ })
+ mux.HandleFunc("GET /models/", func(w http.ResponseWriter, r *http.Request) {
+ http.Redirect(w, r, "../models", http.StatusPermanentRedirect)
+ })
+ mux.Handle("/", files)
+ return mux
}