feat 网关继承微服务Swagger
This commit is contained in:
@ -0,0 +1,27 @@
|
||||
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();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user