2019-10-25 17:16:24 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
2020-01-12 22:09:30 +08:00
|
|
|
_ "git.eve.moe/jackyyf/navigator/api/beacon/v1"
|
|
|
|
_ "git.eve.moe/jackyyf/navigator/api/navigator"
|
|
|
|
"git.eve.moe/jackyyf/navigator/ipgeo"
|
|
|
|
"git.eve.moe/jackyyf/navigator/mapping"
|
2020-02-01 15:06:00 +08:00
|
|
|
"github.com/sirupsen/logrus"
|
2019-10-28 23:29:21 +08:00
|
|
|
"log"
|
2019-10-25 17:16:24 +08:00
|
|
|
"net/http"
|
|
|
|
_ "net/http/pprof"
|
2020-02-01 15:06:00 +08:00
|
|
|
"os"
|
2019-10-25 17:16:24 +08:00
|
|
|
)
|
|
|
|
|
2019-10-28 23:29:21 +08:00
|
|
|
var (
|
|
|
|
listen_spec = flag.String("bind", "127.0.0.1:8086", "http server bind spec")
|
|
|
|
)
|
|
|
|
|
2019-10-25 17:16:24 +08:00
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
2020-02-01 15:06:00 +08:00
|
|
|
logrus.SetReportCaller(true)
|
|
|
|
logrus.SetOutput(os.Stderr)
|
2019-11-17 03:51:15 +08:00
|
|
|
ipgeo.Initialize()
|
|
|
|
mapping.Initialize()
|
2019-10-28 23:29:21 +08:00
|
|
|
log.Println("HTTP server is running on", *listen_spec)
|
|
|
|
http.ListenAndServe(*listen_spec, nil)
|
2019-10-25 17:16:24 +08:00
|
|
|
}
|