Enable dev assets mode with PGWEB_ASSETS_DEVMODE env var

This commit is contained in:
Dan Sosedoff
2022-12-03 18:27:46 -06:00
parent be9a564874
commit 695a99dade
2 changed files with 19 additions and 4 deletions

View File

@@ -63,7 +63,7 @@ func GetHome(prefix string) http.Handler {
if prefix != "" {
prefix = "/" + prefix
}
return http.StripPrefix(prefix, http.FileServer(http.FS(static.Static)))
return http.StripPrefix(prefix, static.GetHandler())
}
func GetAssets(prefix string) http.Handler {
@@ -72,7 +72,7 @@ func GetAssets(prefix string) http.Handler {
} else {
prefix = "/static/"
}
return http.StripPrefix(prefix, http.FileServer(http.FS(static.Static)))
return http.StripPrefix(prefix, static.GetHandler())
}
// GetSessions renders the number of active sessions