diff --git a/controller/ROOT/main.go b/controller/ROOT/main.go index 6088939..97fb347 100644 --- a/controller/ROOT/main.go +++ b/controller/ROOT/main.go @@ -3,7 +3,7 @@ package main import ( "git.xdrm.io/example/aicra/db" e "git.xdrm.io/go/aicra/err" - i "git.xdrm.io/go/aicra/implement" + i "git.xdrm.io/go/aicra/response" ) // Redirects to an url from a key diff --git a/controller/token/main.go b/controller/token/main.go index 40e090e..e6e70bd 100644 --- a/controller/token/main.go +++ b/controller/token/main.go @@ -5,7 +5,7 @@ import ( "encoding/hex" "git.xdrm.io/example/aicra/db" e "git.xdrm.io/go/aicra/err" - i "git.xdrm.io/go/aicra/implement" + i "git.xdrm.io/go/aicra/response" "strconv" "time" ) diff --git a/main.go b/main.go index 7677cb2..ab29e90 100644 --- a/main.go +++ b/main.go @@ -3,20 +3,22 @@ package main import ( "git.xdrm.io/go/aicra" "log" + "net/http" ) func main() { + listen_addr := "127.0.0.1:4242" + server, err := aicra.New("manifest.json") if err != nil { - log.Fatal("cannot load config", err) + panic("cannot load config") } - log.Printf("[Server up] 0.0.0.0:4242\n") - - err = server.Listen(4242) + log.Printf("[Server up] %s\n", listen_addr) + err = http.ListenAndServe(listen_addr, server) if err != nil { - log.Fatalf("*** server failed (%s)\n", err) + panic(err) } }