diff --git a/internal/httpserver/staticFiles.go b/internal/httpserver/staticFiles.go index f2c9a92..8fa817b 100644 --- a/internal/httpserver/staticFiles.go +++ b/internal/httpserver/staticFiles.go @@ -5,6 +5,7 @@ package httpserver import ( "embed" + "github.com/gorilla/mux" "io/fs" "net/http" "os" @@ -26,7 +27,7 @@ func (spa *spaFileSystem) Open(name string) (http.File, error) { return f, err } -func initStatic(e *mux.Router) { +func initStatic(r *mux.Router) { staticFS, _ := fs.Sub(staticFiles, "static") - r.Handle("/", http.FileServer(&spaFileSystem{http.FS(staticFS)})) + r.PathPrefix("/").Handler(http.FileServer(&spaFileSystem{http.FS(staticFS)})) }