//go:build dev package assets import ( "net/http" "os" "github.com/rs/zerolog/log" ) func Handler() http.Handler { log.Debug().Str("path", DirectoryPath).Msg("static assets served from filesystem") return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Cache-Control", "no-store") http.StripPrefix("/assets/", http.FileServerFS(os.DirFS(DirectoryPath))).ServeHTTP(w, r) }) } func StaticPath(path string) string { return "/assets/" + path }