package initialization import ( "appNewPlatform/appConstant" "appNewPlatform/config/app" "fmt" ) // 启动服务 func RunItem() { //加载基础配置 RunViper(&appConstant.Constant_Config, appConstant.AppConfigPath) routers := InitializeRouter() portStr := fmt.Sprintf(":%d", appConstant.Constant_Config.Appsetup.Port) startUp := app.InitServer(portStr, routers) fmt.Printf("\n\n默认API运行地址:http://127.0.0.1%s\n", portStr) err := startUp.ListenAndServe().Error() fmt.Printf("\n\n%s\n", err) panic(fmt.Errorf(err)) }