2018-07-08 13:29:25 +00:00
|
|
|
package main
|
2018-06-10 20:49:32 +00:00
|
|
|
|
|
|
|
import (
|
2018-07-05 17:18:25 +00:00
|
|
|
"git.xdrm.io/go/aicra"
|
2018-06-10 20:49:32 +00:00
|
|
|
"log"
|
2018-07-11 17:08:09 +00:00
|
|
|
"net/http"
|
2018-06-10 20:49:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
2018-10-01 17:28:54 +00:00
|
|
|
listenTo := "127.0.0.1:4242"
|
2018-07-11 17:08:09 +00:00
|
|
|
|
2018-10-01 17:28:54 +00:00
|
|
|
server, err := aicra.New("api.json")
|
2018-06-10 20:49:32 +00:00
|
|
|
if err != nil {
|
2018-09-28 14:06:20 +00:00
|
|
|
panic(err)
|
2018-06-10 20:49:32 +00:00
|
|
|
}
|
|
|
|
|
2018-10-01 17:28:54 +00:00
|
|
|
log.Printf("[Server up] %s\n", listenTo)
|
|
|
|
err = http.ListenAndServe(listenTo, server)
|
2018-06-10 20:49:32 +00:00
|
|
|
if err != nil {
|
2018-07-11 17:08:09 +00:00
|
|
|
panic(err)
|
2018-06-10 20:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|