fix: correct path handling for static

on docker, you'd need to do /static and not /app/static
This commit is contained in:
jabuxas 2024-09-18 10:19:04 -03:00
parent 9d23b391fe
commit 1ab01ac492

View File

@ -44,7 +44,7 @@ func (app *Application) indexHandler(w http.ResponseWriter, r *http.Request) {
if fileInfo, err := os.Stat(path); err == nil && !fileInfo.IsDir() { if fileInfo, err := os.Stat(path); err == nil && !fileInfo.IsDir() {
http.ServeFile(w, r, path) http.ServeFile(w, r, path)
} else { } else {
http.StripPrefix("/", http.FileServer(http.Dir("static"))).ServeHTTP(w, r) http.StripPrefix("/", http.FileServer(http.Dir("./static"))).ServeHTTP(w, r)
} }
} }