main.go
530 Bytes
package main
import (
"flag"
"fmt"
"net/http"
"runtime"
"client/bulletin/common"
"client/bulletin/db"
"client/bulletin/handler"
)
func main() {
configPath := flag.String("config", "conf/config.dev.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())
}
}