Serve index.html of a folder if present

This commit is contained in:
Caleb Gardner
2023-09-17 05:51:36 -05:00
parent f52671a7d0
commit b530295c0b
+3
View File
@@ -73,6 +73,9 @@ func (f *fileOrIndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if !inf.IsDir() {
http.ServeFile(w, r, reqPath)
return
} else if _, err = os.Open(path.Join(reqPath, "index.html")); err == nil {
http.ServeFile(w, r, path.Join(reqPath, "index.html"))
return
}
}
for _, a := range f.appFolders {