Serve index.html of a folder if present
This commit is contained in:
@@ -73,6 +73,9 @@ func (f *fileOrIndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
if !inf.IsDir() {
|
if !inf.IsDir() {
|
||||||
http.ServeFile(w, r, reqPath)
|
http.ServeFile(w, r, reqPath)
|
||||||
return
|
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 {
|
for _, a := range f.appFolders {
|
||||||
|
|||||||
Reference in New Issue
Block a user