chore: set public path on the fly

This commit is contained in:
Ramires Viana
2021-04-20 19:51:10 +00:00
parent 8a47aee137
commit 4711e7bcd5
2 changed files with 5 additions and 5 deletions

View File

@@ -126,12 +126,9 @@ func getStaticHandlers(store *storage.Storage, server *settings.Server, assetsFs
}
}
if !strings.HasSuffix(r.URL.Path, ".js") {
http.FileServer(http.FS(assetsFs)).ServeHTTP(w, r)
return 0, nil
}
http.FileServer(http.FS(assetsFs)).ServeHTTP(w, r)
return handleWithStaticData(w, r, d, assetsFs, r.URL.Path, "application/javascript; charset=utf-8")
return 0, nil
}, "/static/", store, server)
return index, static