fix(webui): serve embedded static from /static/* correctly (fs.Sub(staticFS, "static"))

This commit is contained in:
Thomas Cravey 2025-08-17 13:36:37 -05:00
parent ab11490807
commit fb92930e7a

View file

@ -64,7 +64,7 @@ func (s *Server) Start(ctx context.Context) error {
mux.HandleFunc("/", s.handleUIDash) mux.HandleFunc("/", s.handleUIDash)
mux.HandleFunc("/summarizer", s.handleUISummarizer) mux.HandleFunc("/summarizer", s.handleUISummarizer)
// Serve embedded static files under /static/ // Serve embedded static files under /static/
if sub, err := fs.Sub(staticFS, "."); err == nil { if sub, err := fs.Sub(staticFS, "static"); err == nil {
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(sub)))) mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(sub))))
} }
mux.HandleFunc("/login", s.handleLogin) mux.HandleFunc("/login", s.handleLogin)