You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.5 KiB
51 lines
1.5 KiB
2 years ago
|
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
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// </summary>
|
||
|
public class Program
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 启动程序
|
||
|
/// </summary>
|
||
|
/// <param name="args"></param>
|
||
|
public static void Main(string[] args)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
Console.WriteLine("start...");
|
||
|
CreateHostBuilder(args).Build().Run();
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
Console.WriteLine(ex);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// </summary>
|
||
|
/// <param name="args"></param>
|
||
|
/// <returns></returns>
|
||
|
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<Startup>()
|
||
|
.UseUrls("http://*:8091");
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|