mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 07:19:26 +00:00
Logging update
This commit is contained in:
parent
541f016eaf
commit
2098aface9
13 changed files with 119 additions and 91 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue