fix 关闭网关服务发现
This commit is contained in:
@ -18,7 +18,6 @@ try
|
|||||||
});
|
});
|
||||||
builder.Host
|
builder.Host
|
||||||
.AddAppSettingsSecretsJson()
|
.AddAppSettingsSecretsJson()
|
||||||
.AddYarpJson()
|
|
||||||
.UseAutofac()
|
.UseAutofac()
|
||||||
.UseSerilog();
|
.UseSerilog();
|
||||||
|
|
||||||
|
|||||||
@ -1,27 +0,0 @@
|
|||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
|
|
||||||
namespace KonSoft.Shared.Hosting.Gateways
|
|
||||||
{
|
|
||||||
public static class AbpHostingHostBuilderExtensions
|
|
||||||
{
|
|
||||||
public const string AppYarpJsonPath = "yarp.json";
|
|
||||||
|
|
||||||
public static IHostBuilder AddYarpJson(
|
|
||||||
this IHostBuilder hostBuilder,
|
|
||||||
bool optional = true,
|
|
||||||
bool reloadOnChange = true,
|
|
||||||
string path = AppYarpJsonPath)
|
|
||||||
{
|
|
||||||
return hostBuilder.ConfigureAppConfiguration((_, builder) =>
|
|
||||||
{
|
|
||||||
builder.AddJsonFile(
|
|
||||||
path: AppYarpJsonPath,
|
|
||||||
optional: optional,
|
|
||||||
reloadOnChange: reloadOnChange
|
|
||||||
)
|
|
||||||
.AddEnvironmentVariables();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -16,7 +16,7 @@ public class KonSoftSharedHostingGatewaysModule : AbpModule
|
|||||||
context.Services.AddHttpForwarderWithServiceDiscovery();
|
context.Services.AddHttpForwarderWithServiceDiscovery();
|
||||||
|
|
||||||
context.Services.AddReverseProxy()
|
context.Services.AddReverseProxy()
|
||||||
.LoadFromConfig(configuration.GetSection("ReverseProxy"))
|
.LoadFromConfig(configuration.GetSection("ReverseProxy"));
|
||||||
.AddServiceDiscoveryDestinationResolver();
|
//.AddServiceDiscoveryDestinationResolver();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user