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) {

View file

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>404 - BALLS</title>
<style>
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
</style>
</head>
<body>
<h1>Balls found</h1>
<span>So not the content you're looking for.</span>
</body>
</html>

BIN
be/macrame Normal file

Binary file not shown.

BIN
be/macrame.exe Normal file

Binary file not shown.

BIN
be/main.exe Normal file

Binary file not shown.

View file

@ -30,6 +30,8 @@ func main() {
func apiInit(w http.ResponseWriter, r *http.Request) {
app.ApiCORS(w, r)
app.MCRMLog("Remote IP: " + r.RemoteAddr)
if r.Method == "GET" {
app.ApiGet(w, r)
} else if r.Method == "POST" {