upd: UseSwaggerUIWithYarp
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
using Yarp.ReverseProxy.Configuration;
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Yarp.ReverseProxy.Configuration;
|
||||||
namespace KonSoft.InternalGateway.Extensions
|
namespace KonSoft.InternalGateway.Extensions
|
||||||
{
|
{
|
||||||
public static class YarpSwaggerUIBuilderExtensions
|
public static class YarpSwaggerUIBuilderExtensions
|
||||||
@ -24,7 +25,6 @@ namespace KonSoft.InternalGateway.Extensions
|
|||||||
.Select(t => t.First())
|
.Select(t => t.First())
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
foreach (var clusterGroup in groupedClusters)
|
foreach (var clusterGroup in groupedClusters)
|
||||||
{
|
{
|
||||||
var routeConfig = yarpConfig.Routes.FirstOrDefault(q =>
|
var routeConfig = yarpConfig.Routes.FirstOrDefault(q =>
|
||||||
@ -35,7 +35,8 @@ namespace KonSoft.InternalGateway.Extensions
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
options.SwaggerEndpoint($"{clusterGroup.Value.Address}/swagger/v1/swagger.json", $"{routeConfig.RouteId} API");
|
// options.SwaggerEndpoint($"{clusterGroup.Value.Address}/swagger/v1/swagger.json", $"{routeConfig.RouteId} API");
|
||||||
|
options.SwaggerEndpoint(new Uri(new Uri(clusterGroup.Value.Address), "/swagger/v1/swagger.json").AbsoluteUri, $"{routeConfig.RouteId} API");
|
||||||
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
|
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
|
||||||
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
|
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user