diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 7143b8724..0b3bfd77b 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -74,16 +74,10 @@ if (urlsIndex > -1) NewId.SetProcessIdProvider(new CurrentProcessIdProvider()); - +builder.Configuration.AddJsonFile("appsettings.json", false, true) + .AddJsonFile($"appsettings.{enviromentName}.json", false, true); builder.Host - .ConfigureAppConfiguration((hostContext, config) => - { - - //Console.WriteLine(hostContext.HostingEnvironment.EnvironmentName); - config.AddJsonFile("appsettings.json", false, true) - .AddJsonFile($"appsettings.{enviromentName}.json", false, true); - }) .UseServiceProviderFactory(new AutofacServiceProviderFactory()) .ConfigureContainer(containerBuilder => { @@ -247,15 +241,11 @@ app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); app.UseAuthentication(); app.UseAuthorization(); +app.MapControllers(); -app.UseEndpoints(endpoints => -{ - endpoints.MapControllers(); +app.MapHub("/UploadHub"); +app.MapHealthChecks("/health"); - endpoints.MapHub("/UploadHub"); - - endpoints.MapHealthChecks("/health"); -}); // Serilog SerilogExtension.AddSerilogSetup(enviromentName, app.Services);