mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 07:19:26 +00:00
WIP: Update to the go api.
This commit is contained in:
parent
03181cf6a4
commit
3b38372b4b
16 changed files with 317 additions and 30 deletions
22
be/main.go
22
be/main.go
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue