WIP: Alpha version bugfixes

This commit is contained in:
Jesse Malotaux 2025-04-13 13:07:15 +02:00
parent fd9430dbc6
commit cb5516f863
18 changed files with 474 additions and 144 deletions

View file

@ -26,7 +26,9 @@ func ApiCORS(w http.ResponseWriter, r *http.Request) (http.ResponseWriter, *http
func ApiGet(w http.ResponseWriter, r *http.Request) {
file := "" // base directory
if r.URL.Path != "/" {
if strings.Contains(r.URL.Path, "/config.js") {
file = "../public/config.js"
} else if r.URL.Path != "/" {
file = "../public" + r.URL.Path // request
}
@ -40,7 +42,7 @@ func ApiGet(w http.ResponseWriter, r *http.Request) {
file = "../public/index.html" // default
}
http.ServeFile(w, r, file) // serve file
http.ServeFile(w, r, file)
}
func ApiPost(w http.ResponseWriter, r *http.Request) {