From 5875a6a62e59cd23360e2a51cc729f1c96d30161 Mon Sep 17 00:00:00 2001 From: malik masis Date: Tue, 13 Sep 2022 16:06:52 +0300 Subject: [PATCH] Configured WebPublicGateway --- .../src/EShopOnAbp.WebPublicGateway/Dockerfile | 1 + .../EShopOnAbpWebPublicGatewayModule.cs | 13 +++++++------ .../appsettings.Docker.json | 17 +++++++++++++++-- .../appsettings.Staging.json | 17 +++++++++++++++-- 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile index f998efe9..49ea9b3f 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/Dockerfile +++ b/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" diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs index d99b84ab..91b26fba 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs +++ b/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 => { diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Docker.json b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Docker.json index 6e3ee56f..6c082207 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Docker.json +++ b/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": { diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Staging.json b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Staging.json index c4e04d13..4aa66c8b 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.Staging.json +++ b/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": {