From b4df799a37e56b32a005184458f41b6f5197f4f4 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 6 Dec 2023 11:20:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7net8=20Program=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Progranm.cs | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) 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);