config path

This commit is contained in:
wangchuxiao
2023-02-23 19:51:58 +08:00
parent 50664c2486
commit 7930c230e4
10 changed files with 57 additions and 78 deletions
+3 -1
View File
@@ -20,7 +20,9 @@ func main() {
ginPort := flag.Int("port", config.Config.Api.GinPort[0], "get ginServerPort from cmd,default 10002 as port")
configPath := flag.String("config_path", "../config/", "config folder")
flag.Parse()
config.InitConfig(*configPath)
if err := config.InitConfig(*configPath); err != nil {
panic(err.Error())
}
address := "0.0.0.0:" + strconv.Itoa(*ginPort)
if config.Config.Api.ListenIP != "" {
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)