Browse Source

Handle endpoint pipelines that are different from gateways

pull/85/head
cKey 5 years ago
parent
commit
bcbb46ef66
  1. 12
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/ApiGatewayHostModule.cs

12
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/ApiGatewayHostModule.cs

@ -173,8 +173,18 @@ namespace LINGYUN.ApiGateway
var app = context.GetApplicationBuilder();
app.UseAuditing();
app.UseVirtualFiles();
app.UseRouting();
app.UseConfiguredEndpoints();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.MapWhen(
ctx => ctx.Request.Path.ToString().StartsWith("/api/ApiGateway/Basic/"),
appNext =>
{
// 仅针对属于网关自己的控制器进入MVC管道
appNext.UseRouting();
appNext.UseConfiguredEndpoints();
});
// 启用ws协议
app.UseWebSockets();
app.UseOcelot().Wait();

Loading…
Cancel
Save