Logging update

This commit is contained in:
Jesse Malotaux 2025-04-11 17:49:28 +02:00
parent 541f016eaf
commit 2098aface9
13 changed files with 119 additions and 91 deletions

View file

@ -2,7 +2,6 @@ package app
import (
"be/app/helper"
"log"
"mime"
"net/http"
"path/filepath"
@ -40,19 +39,19 @@ func ApiGet(w http.ResponseWriter, r *http.Request) {
file = "../public/index.html" // default
}
// log.Println("GET:", file)
// app.MCRMLog("GET:", file)
http.ServeFile(w, r, file) // serve file
}
func ApiPost(w http.ResponseWriter, r *http.Request) {
access, data := helper.EndpointAccess(w, r)
access, data, err := helper.EndpointAccess(w, r)
if !access {
if !access || err != nil {
MCRMLog("ApiPost EndPointAccess Error: ", err)
return
}
log.Println("api post", data == "")
if data != "" {
ApiAuth(data, w, r)
return
@ -95,7 +94,6 @@ func ApiPost(w http.ResponseWriter, r *http.Request) {
}
func ApiAuth(data string, w http.ResponseWriter, r *http.Request) {
log.Println("apiauth", data != "")
switch r.URL.Path {
case "/macro/play":
PlayMacro(data, w, r)