Browse Source

Configured WebPublicGateway

gterdem/swagger_update
malik masis 4 years ago
parent
commit
5875a6a62e
  1. 1
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile
  2. 13
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs
  3. 17
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Docker.json
  4. 17
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Staging.json

1
gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile

@ -28,6 +28,7 @@ COPY "services/basket/src/EShopOnAbp.BasketService/EShopOnAbp.BasketService.cspr
COPY "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj"
COPY "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj"
COPY "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj"
COPY "services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj" "services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj"
# Gateways
COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj"

13
gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs

@ -1,13 +1,13 @@
using EShopOnAbp.Shared.Hosting.Gateways;
using EShopOnAbp.Shared.Hosting.AspNetCore;
using EShopOnAbp.Shared.Hosting.Gateways;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Rewrite;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.Collections.Generic;
using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Http;
using Volo.Abp;
using Volo.Abp.Modularity;
using Microsoft.AspNetCore.Rewrite;
namespace EShopOnAbp.WebPublicGateway;
@ -33,6 +33,7 @@ public class EShopOnAbpWebPublicGatewayModule : AbpModule
{ "BasketService", "Basket Service API" },
{ "PaymentService", "Payment Service API" },
{ "OrderingService", "Ordering Service API" },
{ "CmskitService", "Cmskit Service API" },
},
apiTitle: "WebPublic Gateway"
);
@ -54,11 +55,11 @@ public class EShopOnAbpWebPublicGatewayModule : AbpModule
app.UseCorrelationId();
app.UseAbpSerilogEnrichers();
app.UseSwaggerUIWithYarp(context);
app.UseRewriter(new RewriteOptions()
// Regex for "", "/" and "" (whitespace)
.AddRedirect("^(|\\|\\s+)$", "/swagger"));
app.UseRouting();
app.UseEndpoints(endpoints =>
{

17
gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Docker.json

@ -37,11 +37,17 @@
"Path": "/api/payment/{**everything}"
}
},
"Cmskit Service": {
"ClusterId": "cmskitCluster",
"Match": {
"Path": "/api/cmskit/{**everything}"
}
},
"product-picture-route": {
"ClusterId": "productPictureCluster",
"Match": {
"Path": "/product-images/{**everything}",
"Methods" : [ "GET" ]
"Methods": [ "GET" ]
}
}
},
@ -73,7 +79,7 @@
"Address": "http://basket-service"
}
}
},
},
"orderingCluster": {
"Destinations": {
"destination1": {
@ -88,6 +94,13 @@
}
}
},
"cmskitCluster": {
"Destinations": {
"destination1": {
"Address": "http://cmskit-service"
}
}
},
"productPictureCluster": {
"Destinations": {
"destination1": {

17
gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Staging.json

@ -37,11 +37,17 @@
"Path": "/api/payment/{**everything}"
}
},
"Cmskit Service": {
"ClusterId": "cmskitCluster",
"Match": {
"Path": "/api/cmskit/{**everything}"
}
},
"product-picture-route": {
"ClusterId": "productPictureCluster",
"Match": {
"Path": "/product-images/{**everything}",
"Methods" : [ "GET" ]
"Methods": [ "GET" ]
}
}
},
@ -73,7 +79,7 @@
"Address": "http://eshop-st-basket"
}
}
},
},
"orderingCluster": {
"Destinations": {
"destination1": {
@ -88,6 +94,13 @@
}
}
},
"cmskitCluster": {
"Destinations": {
"destination1": {
"Address": "http://eshop-st-cmskit"
}
}
},
"productPictureCluster": {
"Destinations": {
"destination1": {

Loading…
Cancel
Save