using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using System; using System.IO; using Znyc.Cloudcar.Admin.Commons; using Znyc.Cloudcar.Admin.Commons.Core.App; namespace Znyc.Cloudcar.Admin.WebApi { /// /// public class Program { /// /// 启动程序 /// /// public static void Main(string[] args) { try { Console.WriteLine("start..."); CreateHostBuilder(args).Build().Run(); } catch (Exception ex) { Console.WriteLine(ex); } } /// /// /// /// public static IHostBuilder CreateHostBuilder(string[] args) { IConfigurationRoot config = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile( $"appsettings.{Environment.GetEnvironmentVariable(SystemConst.ASPNETCORE_ENVIRONMENT)}.json") .Build(); App.Configuration = config; return Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup() .UseUrls("http://*:8091"); }); } } }