Initial commit: Aeroflot Flights Web Angular 12 application
This commit is contained in:
+46
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace Aeroflot.Flights.Web
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
|
||||
.Enrich.FromLogContext()
|
||||
.WriteTo.Debug()
|
||||
.WriteTo.Console()
|
||||
.CreateBootstrapLogger();
|
||||
|
||||
Log.Information("Starting up");
|
||||
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
Log.Information("Host created.");
|
||||
|
||||
try
|
||||
{
|
||||
host.Run();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Log.CloseAndFlush();
|
||||
}
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args)
|
||||
{
|
||||
var host = Host.CreateDefaultBuilder(args)
|
||||
.UseSerilog((context, configuration) => configuration.ReadFrom.Configuration(context.Configuration))
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
return host;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user