Move css to seperate file and add no-cache for dev assets

This commit is contained in:
2023-09-05 09:04:54 -04:00
parent a8f9d87b47
commit 9dceae06a7
3 changed files with 88 additions and 86 deletions

View File

@@ -53,7 +53,10 @@ func main() {
if localAssets {
httpFileServer := http.FileServer(http.Dir("web"))
http.Handle("/", httpFileServer)
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Cache-Control", "no-cache")
httpFileServer.ServeHTTP(w, r)
})
} else {
fs, err := fs.Sub(webFS, "web")