main.go
519 Bytes
package main
import (
"flag"
"fmt"
"net/http"
"runtime"
"client/gift/common"
"client/gift/db"
"client/gift/handler"
)
func main() {
configPath := flag.String("config", "conf/config.gift.toml", "config file's path")
flag.Parse()
common.InitConfig(*configPath)
if common.Config.Gomaxprocs >= 1 {
runtime.GOMAXPROCS(common.Config.Gomaxprocs)
}
db.InitMysql(common.Config.Mysql)
if err := http.ListenAndServe(common.Config.Listen, handler.BugInfoEngine()); err != nil {
fmt.Println(err.Error())
}
}