Update examples
This commit is contained in:
@@ -1,22 +1,43 @@
|
||||
using GerstITS.Logging.Serilog;
|
||||
using System.Diagnostics;
|
||||
using GerstITS.Web.Api;
|
||||
using GerstITS.Web.Api.Hosting;
|
||||
using GerstITS.Web.Api.Swagger;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Serilog;
|
||||
|
||||
namespace GerstITS.Examples.Api;
|
||||
|
||||
public class Program : ProgramBase<Program>
|
||||
public class Program
|
||||
{
|
||||
#region Methods
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
BootstrapLogContext.Execute<Program>(_ => Run(args));
|
||||
HostingStartup.Use(args)
|
||||
.Host()
|
||||
.UseSerilog((context, configuration) => {
|
||||
configuration.ReadFrom.Configuration(context.Configuration);
|
||||
|
||||
if (Common.ApplicationEnvironment.IsEfCoreActionStarted)
|
||||
Debug.WriteLine("==========>>>>>>> Do NOT start Application!!!!");
|
||||
})
|
||||
.Services()
|
||||
.Build()
|
||||
.IfProduction(app => app.UsePreconfiguredHsts())
|
||||
.IfDevelopment(app => app.UseDeveloperExceptionPage()
|
||||
.UsePreconfiguredSwagger())
|
||||
.UsePreconfiguredCors()
|
||||
.UsePreconfiguredForwardedHeaders()
|
||||
.UsePreconfiguredHttpsRedirection()
|
||||
.UseAuthentication()
|
||||
.UseAuthorization()
|
||||
.UseRouting()
|
||||
.UseEndpoints(endpoints => endpoints.MapControllers())
|
||||
.UseRewriteUnknownPathsToIndexSite(ApplicationEnvironment.WebApi.BaseUrl)
|
||||
.UseSystemIndependentStaticFiles()
|
||||
.UseSerilogRequestLogging()
|
||||
.Run();
|
||||
}
|
||||
|
||||
protected override void ConfigureWebHost(IWebHostBuilder webHostBuilder)
|
||||
{
|
||||
webHostBuilder.UseLogging()
|
||||
.UseStartup<Startup>();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user