2021-01-20 17:57:32 +01:00
|
|
|
|
using eShopConContainers.WebSPA;
|
|
|
|
|
using Microsoft.AspNetCore;
|
2017-08-29 12:14:10 +02:00
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
2017-10-11 16:26:44 +02:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
2021-01-20 17:57:32 +01:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2018-12-13 12:13:59 +01:00
|
|
|
|
using Serilog;
|
2021-01-20 17:57:32 +01:00
|
|
|
|
using System.IO;
|
2016-11-17 10:34:10 +01:00
|
|
|
|
|
2020-12-18 09:48:28 +01:00
|
|
|
|
BuildWebHost(args).Run();
|
2017-08-29 12:14:10 +02:00
|
|
|
|
|
2020-12-18 09:48:28 +01:00
|
|
|
|
IWebHost BuildWebHost(string[] args) =>
|
|
|
|
|
WebHost.CreateDefaultBuilder(args)
|
|
|
|
|
.UseStartup<Startup>()
|
|
|
|
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
|
|
|
|
.ConfigureAppConfiguration((builderContext, config) =>
|
|
|
|
|
{
|
|
|
|
|
config.AddEnvironmentVariables();
|
|
|
|
|
})
|
|
|
|
|
.ConfigureLogging((hostingContext, builder) =>
|
|
|
|
|
{
|
|
|
|
|
builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
|
|
|
|
|
builder.AddConsole();
|
|
|
|
|
builder.AddDebug();
|
|
|
|
|
builder.AddAzureWebAppDiagnostics();
|
|
|
|
|
})
|
|
|
|
|
.UseSerilog((builderContext, config) =>
|
|
|
|
|
{
|
|
|
|
|
config
|
|
|
|
|
.MinimumLevel.Information()
|
|
|
|
|
.Enrich.FromLogContext()
|
|
|
|
|
.WriteTo.Console();
|
|
|
|
|
})
|
|
|
|
|
.Build();
|