public void Start() { thread = new Thread(() => { host = new WebHostBuilder() .UseUrls($"http://{ServerConfSetting.serverSettingModel.Server.ip}:{ServerConfSetting.serverSettingModel.Web.port}") .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup <Startup>() .Build(); boot.RUN(); host.Run(); }); thread.Start(); }
static void Main(string[] args) { var host = new WebHostBuilder() .UseUrls($"http://{ServerConfSetting.serverSettingModel.Server.ip}:{ServerConfSetting.serverSettingModel.Web.port}") .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup <Startup>() .Build(); var boot = new RatelServerBoot(); boot.RUN(); host.Run(); boot.Close(); }