config path

test-errcode
wangchuxiao 2 years ago
parent ffaf0bd021
commit cfe6aff3ac

@ -17,12 +17,14 @@ func main() {
log.NewPrivateLog(constant.LogFileName)
router := api.NewGinRouter()
go third.MinioInit()
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()
if err := config.InitConfig(*configPath); err != nil {
panic(err.Error())
}
ginPort := flag.Int("port", config.Config.Api.GinPort[0], "get ginServerPort from cmd,default 10002 as port")
flag.Parse()
address := "0.0.0.0:" + strconv.Itoa(*ginPort)
if config.Config.Api.ListenIP != "" {
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)

@ -8,6 +8,6 @@ import (
func main() {
startrpc.Start(config.Config.RpcPort.OpenImUserPort[0], config.Config.RpcRegisterName.OpenImUserName, config.Config.Prometheus.UserPrometheusPort[0], user.Start)
startrpc.Start(config.Config.RpcPort.OpenImUserPort, config.Config.RpcRegisterName.OpenImUserName, config.Config.Prometheus.UserPrometheusPort[0], user.Start)
}

Loading…
Cancel
Save