WIP: Update to the go api.

This commit is contained in:
Jesse Malotaux 2025-03-24 20:22:31 +01:00
parent 03181cf6a4
commit 3b38372b4b
16 changed files with 317 additions and 30 deletions

View file

@ -9,18 +9,18 @@ import (
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
app.ApiCORS(w, r)
if r.Method == "GET" {
app.ApiGet(w, r)
} else if r.Method == "POST" {
app.ApiPost(w, r)
}
apiInit(w, r)
})
// helper.OpenBrowser("http://localhost:6970")
log.Fatal(http.ListenAndServe(":6970", nil))
}
func apiInit(w http.ResponseWriter, r *http.Request) {
app.ApiCORS(w, r)
if r.Method == "GET" {
app.ApiGet(w, r)
} else if r.Method == "POST" {
app.ApiPost(w, r)
}
}