mirror of
https://gitee.com/iioter/iotgateway.git
synced 2024-12-02 03:38:01 +08:00
45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
|
using System.Collections.Generic;
|
|||
|
using Microsoft.AspNetCore.Builder;
|
|||
|
using Microsoft.AspNetCore.Hosting;
|
|||
|
using Microsoft.Extensions.Configuration;
|
|||
|
using Microsoft.Extensions.DependencyInjection;
|
|||
|
using Microsoft.Extensions.Hosting;
|
|||
|
using Microsoft.Extensions.Logging;
|
|||
|
using WalkingTec.Mvvm.Core;
|
|||
|
|
|||
|
namespace IoTGateway
|
|||
|
{
|
|||
|
public class Program
|
|||
|
{
|
|||
|
public static void Main(string[] args)
|
|||
|
{
|
|||
|
CreateWebHostBuilder(args).Build().Run();
|
|||
|
}
|
|||
|
|
|||
|
public static IHostBuilder CreateWebHostBuilder(string[] args)
|
|||
|
{
|
|||
|
return
|
|||
|
Host.CreateDefaultBuilder(args)
|
|||
|
.ConfigureAppConfiguration((hostingContext, config) =>
|
|||
|
{
|
|||
|
config.AddInMemoryCollection(new Dictionary<string, string> { { "HostRoot", hostingContext.HostingEnvironment.ContentRootPath } });
|
|||
|
})
|
|||
|
.ConfigureLogging((hostingContext, logging) =>
|
|||
|
{
|
|||
|
logging.ClearProviders();
|
|||
|
logging.AddConsole();
|
|||
|
logging.AddWTMLogger();
|
|||
|
})
|
|||
|
.ConfigureWebHostDefaults(webBuilder =>
|
|||
|
{
|
|||
|
webBuilder.UseStartup<Startup>();
|
|||
|
webBuilder.UseKestrel(option =>
|
|||
|
{
|
|||
|
option.ListenAnyIP(518);
|
|||
|
});
|
|||
|
});
|
|||
|
//.UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
|||
|
}
|
|||
|
}
|
|||
|
}
|