Fixed PWA folder paths

This commit is contained in:
Caleb Gardner
2024-08-07 02:37:32 -05:00
parent 2afbd64dc2
commit b7c63ca794
3 changed files with 7 additions and 3 deletions
+5 -2
View File
@@ -103,8 +103,11 @@ func mainHandle(w http.ResponseWriter, r *http.Request) {
if err == nil && !stat.IsDir() {
http.ServeFile(w, r, filepath.Join(*webRoot, path))
return
} else if stat.IsDir() {
ind := filepath.Join(*webRoot, path, "index.html")
}
spl := strings.Split(path, "/")
stat, err = os.Stat(filepath.Join(*webRoot, spl[0]))
if stat.IsDir() {
ind := filepath.Join(*webRoot, spl[0], "index.html")
stat, err = os.Stat(ind)
if err == nil {
http.ServeFile(w, r, ind)