From 448848915c55e84489401f5472013e2b0344e60a Mon Sep 17 00:00:00 2001 From: Robin Olsen Date: Thu, 12 Feb 2026 12:11:20 +0100 Subject: [PATCH] update to use static assets --- pkg/web/server/routes.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/web/server/routes.go b/pkg/web/server/routes.go index 94e439a..0911f81 100644 --- a/pkg/web/server/routes.go +++ b/pkg/web/server/routes.go @@ -26,12 +26,9 @@ func (s *Server) RegisterRoutes(assets embed.FS) http.Handler { } func (s *Server) handleAssets(mux *http.ServeMux, assets embed.FS) { - fileServer := http.FileServer(http.FS(assets)) - mux.Handle("/assets/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Optionally set long-term caching headers for static assets - //w.Header().Set("Cache-Control", "public, max-age=31536000, immutable") - fileServer.ServeHTTP(w, r) - })) + mux.Handle("/assets/", + http.StripPrefix("/assets/", + http.FileServer(http.Dir("pkg/web/assets")))) mux.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Cache-Control", "no-cache")