-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
29 lines (26 loc) · 799 Bytes
/
Program.cs
File metadata and controls
29 lines (26 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using HappyCode.NetCoreBoilerplate.Api;
using HappyCode.NetCoreBoilerplate.Api.Infrastructure.Configurations;
using Microsoft.AspNetCore.Builder;
using Serilog;
Log.Logger = SerilogConfigurator.CreateLogger();
try
{
BannerConfigurator.Print(!Console.IsOutputRedirected);
Log.Logger.Information("Starting up...");
var builder = WebApplication.CreateBuilder();
var startup = new Startup(builder.Configuration);
startup.ConfigureServices(builder.Services);
using var app = builder.Build();
startup.Configure(app, builder.Environment);
await app.RunAsync();
Log.Logger.Debug("I'm done, see ya later!");
}
catch (Exception ex)
{
Log.Logger.Fatal(ex, "Application start-up failed");
throw;
}
finally
{
Log.CloseAndFlush();
}