by Robin at 20240523

This commit is contained in:
Leufolium 2024-05-23 22:47:33 +08:00
parent c9fa28946f
commit 6907d7c8a2
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) {