Merge pull request 'by Robin at 20240523' (#480) from conf into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/480
This commit is contained in:
chenhao 2024-05-23 22:49:08 +08:00
commit e69149220a
1 changed files with 4 additions and 2 deletions

View File

@ -107,14 +107,16 @@ func main() {
// 初始化http server
go exec.Run()
ip := GetIp()
port := cfg.App.Port
router := httpengine.NewRouter()
validator.InitDefaultNotNullValidator()
controller.InitOffline(router)
srv := &http.Server{
Addr: fmt.Sprintf("%s:%d", GetIp(), cfg.App.Port),
Addr: fmt.Sprintf("%s:%d", ip, port),
Handler: router,
}
httpserver.StartHttpServer(srv, cfg.OfflineServer)
httpserver.StartHttpServer(srv, cfg.OfflineServer, ip, port)
}
func PrintAndExit(msg string) {