Fixed PWA folder paths
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
blogTitle = "<h1 class='blog-title'><a href='%v' onclick=\"return setToPath('%v')\" style='text-decoration:none'>%v</a></h1>"
|
||||
blogTitle = "<h1 class='blog-title'><a href='https://darkstorm.tech/%v' onclick=\"return setToPath('%v')\" style='text-decoration:none'>%v</a></h1>"
|
||||
blogAuthor = "<h4 class='blog-author'><i><b>By %v</b></i></h4>"
|
||||
blogCreate = "<h5 class='blog-time'><i>Written on: %v</i></h5>"
|
||||
blogMain = "<div class='blog'>%v</div>"
|
||||
|
||||
@@ -39,6 +39,7 @@ func (b *Backend) countLog(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Query().Get("platform") != "" {
|
||||
//TODO: remove legacy code
|
||||
req.Platform = r.URL.Query().Get("platform")
|
||||
req.ID = r.URL.Query().Get("id")
|
||||
} else {
|
||||
ReturnError(w, http.StatusBadRequest, "invalidBody", "Bad request")
|
||||
return
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user