From 0513950f6f324364814efd595d8b915dd51003d1 Mon Sep 17 00:00:00 2001 From: Tarun Jain Date: Mon, 4 Apr 2022 12:15:22 +0530 Subject: [PATCH 1/2] Commit to implement yarp api gateway - in progress --- .../Mobile.Bff.Shopping/aggregator/Dockerfile | 1 + .../Web.Bff.Shopping/aggregator/Dockerfile | 1 + .../Yarp/WebShoppingAPIGateway/Dockerfile | 61 ++++++++ .../Yarp/WebShoppingAPIGateway/Program.cs | 18 +++ .../Properties/launchSettings.json | 35 +++++ .../WebShoppingAPIGateway.csproj | 17 +++ .../appsettings.Development.json | 8 ++ .../WebShoppingAPIGateway/appsettings.json | 130 ++++++++++++++++++ src/Services/Basket/Basket.API/Dockerfile | 1 + src/Services/Catalog/Catalog.API/Dockerfile | 1 + src/Services/Identity/Identity.API/Dockerfile | 1 + src/Services/Ordering/Ordering.API/Dockerfile | 1 + .../Ordering.BackgroundTasks/Dockerfile | 1 + .../Ordering/Ordering.SignalrHub/Dockerfile | 1 + src/Services/Payment/Payment.API/Dockerfile | 1 + src/Services/Webhooks/Webhooks.API/Dockerfile | 1 + src/Web/WebMVC/Dockerfile | 1 + src/Web/WebSPA/Client/angular.json | 3 +- src/Web/WebSPA/Client/src/proxy.conf.json | 8 ++ src/Web/WebSPA/Client/src/proxy.conf.json.bak | 0 src/Web/WebSPA/Dockerfile | 1 + src/Web/WebSPA/Startup.cs | 11 +- src/Web/WebStatus/Dockerfile | 1 + src/Web/WebhookClient/Dockerfile | 1 + src/docker-compose.override.yml | 15 +- src/docker-compose.yml | 5 +- src/eShopOnContainers-ServicesAndWebApps.sln | 58 +++++++- 27 files changed, 374 insertions(+), 9 deletions(-) create mode 100644 src/ApiGateways/Yarp/WebShoppingAPIGateway/Dockerfile create mode 100644 src/ApiGateways/Yarp/WebShoppingAPIGateway/Program.cs create mode 100644 src/ApiGateways/Yarp/WebShoppingAPIGateway/Properties/launchSettings.json create mode 100644 src/ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj create mode 100644 src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.Development.json create mode 100644 src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.json create mode 100644 src/Web/WebSPA/Client/src/proxy.conf.json create mode 100644 src/Web/WebSPA/Client/src/proxy.conf.json.bak diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile index aab4164b76..c3c1a2d3d7 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile index 8761763a1c..b358824b68 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/ApiGateways/Yarp/WebShoppingAPIGateway/Dockerfile b/src/ApiGateways/Yarp/WebShoppingAPIGateway/Dockerfile new file mode 100644 index 0000000000..b1af1f8170 --- /dev/null +++ b/src/ApiGateways/Yarp/WebShoppingAPIGateway/Dockerfile @@ -0,0 +1,61 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" + +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" +COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" +COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" +COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" +COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj" +COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" +COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" +COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" +COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" +COPY "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj" "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj" +COPY "Services/Basket/Basket.API/Basket.API.csproj" "Services/Basket/Basket.API/Basket.API.csproj" +COPY "Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj" "Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj" +COPY "Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj" "Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj" +COPY "Services/Catalog/Catalog.API/Catalog.API.csproj" "Services/Catalog/Catalog.API/Catalog.API.csproj" +COPY "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj" "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj" +COPY "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj" "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj" +COPY "Services/Identity/Identity.API/Identity.API.csproj" "Services/Identity/Identity.API/Identity.API.csproj" +COPY "Services/Ordering/Ordering.API/Ordering.API.csproj" "Services/Ordering/Ordering.API/Ordering.API.csproj" +COPY "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj" "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj" +COPY "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj" "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj" +COPY "Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj" "Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj" +COPY "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj" "Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj" +COPY "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" "Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj" +COPY "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" "Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj" +COPY "Services/Payment/Payment.API/Payment.API.csproj" "Services/Payment/Payment.API/Payment.API.csproj" +COPY "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" "Services/Webhooks/Webhooks.API/Webhooks.API.csproj" +COPY "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" "Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj" +COPY "Web/WebhookClient/WebhookClient.csproj" "Web/WebhookClient/WebhookClient.csproj" +COPY "Web/WebMVC/WebMVC.csproj" "Web/WebMVC/WebMVC.csproj" +COPY "Web/WebSPA/WebSPA.csproj" "Web/WebSPA/WebSPA.csproj" +COPY "Web/WebStatus/WebStatus.csproj" "Web/WebStatus/WebStatus.csproj" + +COPY "docker-compose.dcproj" "docker-compose.dcproj" + +COPY "NuGet.config" "NuGet.config" + +RUN dotnet restore "eShopOnContainers-ServicesAndWebApps.sln" + +COPY . . +WORKDIR /src/ApiGateways/Yarp/WebShoppingAPIGateway +RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "WebShoppingAPIGateway.dll"] \ No newline at end of file diff --git a/src/ApiGateways/Yarp/WebShoppingAPIGateway/Program.cs b/src/ApiGateways/Yarp/WebShoppingAPIGateway/Program.cs new file mode 100644 index 0000000000..34fb6e1905 --- /dev/null +++ b/src/ApiGateways/Yarp/WebShoppingAPIGateway/Program.cs @@ -0,0 +1,18 @@ +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddReverseProxy().LoadFromConfig(builder.Configuration.GetSection("ReverseProxy")); +builder.Services.AddCors(options => +{ + options.AddPolicy("customPolicy", builder => + { + builder.AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader(); + }); +}); +var app = builder.Build(); +app.UseCors(); +app.MapGet("/", () => "Hello World!"); + +app.MapReverseProxy(); + +app.Run(); diff --git a/src/ApiGateways/Yarp/WebShoppingAPIGateway/Properties/launchSettings.json b/src/ApiGateways/Yarp/WebShoppingAPIGateway/Properties/launchSettings.json new file mode 100644 index 0000000000..bee9b2b49a --- /dev/null +++ b/src/ApiGateways/Yarp/WebShoppingAPIGateway/Properties/launchSettings.json @@ -0,0 +1,35 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:26551", + "sslPort": 44339 + } + }, + "profiles": { + "WebShoppingAPIGateway": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:7118;http://localhost:5118", + "dotnetRunMessages": true + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "publishAllPorts": true, + "useSSL": true + } + } +} \ No newline at end of file diff --git a/src/ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj b/src/ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj new file mode 100644 index 0000000000..9bc3f80c2f --- /dev/null +++ b/src/ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + 7c1733f8-e653-474b-9422-32c68ba1d44e + Linux + ..\..\.. + + + + + + + + diff --git a/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.Development.json b/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.Development.json new file mode 100644 index 0000000000..0c208ae918 --- /dev/null +++ b/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.json b/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.json new file mode 100644 index 0000000000..0cdab786ef --- /dev/null +++ b/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.json @@ -0,0 +1,130 @@ +{ + "Urls": "http://host.docker.internal:5202", + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "ReverseProxy": { + "Routes": { + "minimumroute": { + "ClusterId": "minimumcluster", + "CorsPolicy": "customPolicy", + "Match": { + "Path": "{**catch-all}" + } + }, + "catalog": { + "ClusterId": "catalog", + "CorsPolicy": "customPolicy", + "Match": { + "Methods": [ "GET", "POST" ], + "Hosts": "0.0.0.0", + "Path": "/c/{**catch-all}" + }, + "Transforms": [ + { + "PathRemovePrefix": "/c" + } + ] + }, + "ordering": { + "ClusterId": "ordering", + "CorsPolicy": "customPolicy", + "Match": { + "Methods": [ "GET", "POST" ], + "Hosts": "host.docker.internal", + "Path": "/o/{**catch-all}" + }, + "Transforms": [ + { + "PathRemovePrefix": "/o" + } + ] + }, + "signalr-hub": { + "ClusterId": "signalr-hub", + "CorsPolicy": "customPolicy", + "Match": { + "Methods": [ "GET", "POST" ], + "Hosts": "host.docker.internal", + "Path": "/hub/notificationhub/{**catch-all}" + } + }, + "basket": { + "ClusterId": "basket", + "CorsPolicy": "customPolicy", + "Match": { + "Methods": [ "GET", "POST" ], + "Hosts": "host.docker.internal", + "Path": "/b/{**catch-all}" + }, + "Transforms": [ + { + "PathRemovePrefix": "/b" + } + ] + }, + "shoppingagg": { + "ClusterId": "shoppingagg", + "CorsPolicy": "customPolicy", + "Match": { + "Methods": [ "GET", "POST" ], + "Hosts": "host.docker.internal", + "Path": "/{**catch-all}" + }, + "Transforms": [ + { + "PathPattern": "/{**catch-all}" + } + ] + } + }, + "Clusters": { + "minimumcluster": { + "Destinations": { + "httpbin.org": { + "Address": "https://www.microsoft.com/" + } + } + }, + "catalog": { + "Destinations": { + "catalog_destination": { + "Address": "http://catalog-api/" + } + } + }, + "ordering": { + "Destinations": { + "catalog_destination": { + "Address": "http://ordering-api/" + } + } + }, + "signalr-hub": { + "Destinations": { + "catalog_destination": { + "Address": "http://ordering-signalrhub/" + } + } + }, + "basket": { + "Destinations": { + "catalog_destination": { + "Address": "http://basket-api/" + } + } + }, + "shoppingagg": { + "Destinations": { + "catalog_destination": { + "Address": "http://webshoppingagg/" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/Dockerfile b/src/Services/Basket/Basket.API/Dockerfile index 9cd4abba8b..8b4a106a20 100644 --- a/src/Services/Basket/Basket.API/Dockerfile +++ b/src/Services/Basket/Basket.API/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Services/Catalog/Catalog.API/Dockerfile b/src/Services/Catalog/Catalog.API/Dockerfile index e491c21103..269d520974 100644 --- a/src/Services/Catalog/Catalog.API/Dockerfile +++ b/src/Services/Catalog/Catalog.API/Dockerfile @@ -10,6 +10,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Services/Identity/Identity.API/Dockerfile b/src/Services/Identity/Identity.API/Dockerfile index 674cc4ec1a..cd0fae81bf 100644 --- a/src/Services/Identity/Identity.API/Dockerfile +++ b/src/Services/Identity/Identity.API/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Services/Ordering/Ordering.API/Dockerfile b/src/Services/Ordering/Ordering.API/Dockerfile index 905d3bcd0e..ac578cd5c8 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile +++ b/src/Services/Ordering/Ordering.API/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile b/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile index 0a5ce8f0cb..02b853cd3c 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Services/Ordering/Ordering.SignalrHub/Dockerfile b/src/Services/Ordering/Ordering.SignalrHub/Dockerfile index 33771bf1fc..ad0695655b 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Dockerfile +++ b/src/Services/Ordering/Ordering.SignalrHub/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Services/Payment/Payment.API/Dockerfile b/src/Services/Payment/Payment.API/Dockerfile index e91ed767bb..d7c78266ab 100644 --- a/src/Services/Payment/Payment.API/Dockerfile +++ b/src/Services/Payment/Payment.API/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Services/Webhooks/Webhooks.API/Dockerfile b/src/Services/Webhooks/Webhooks.API/Dockerfile index b5fb886849..5ef78b1cce 100644 --- a/src/Services/Webhooks/Webhooks.API/Dockerfile +++ b/src/Services/Webhooks/Webhooks.API/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Web/WebMVC/Dockerfile b/src/Web/WebMVC/Dockerfile index 470de25d28..6ae06b2f07 100644 --- a/src/Web/WebMVC/Dockerfile +++ b/src/Web/WebMVC/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Web/WebSPA/Client/angular.json b/src/Web/WebSPA/Client/angular.json index 7f95dc451e..47e4401999 100644 --- a/src/Web/WebSPA/Client/angular.json +++ b/src/Web/WebSPA/Client/angular.json @@ -53,7 +53,8 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "WebSPA:build" + "browserTarget": "WebSPA:build", + "proxyConfig": "src/proxy.conf.json" }, "configurations": { "production": { diff --git a/src/Web/WebSPA/Client/src/proxy.conf.json b/src/Web/WebSPA/Client/src/proxy.conf.json new file mode 100644 index 0000000000..f381b9d0ab --- /dev/null +++ b/src/Web/WebSPA/Client/src/proxy.conf.json @@ -0,0 +1,8 @@ +{ + "/api": { + "target": "http://host.docker.internal:5202", + "secure": false, + "changeOrigin": true, + "logLevel": "debug" + } +} \ No newline at end of file diff --git a/src/Web/WebSPA/Client/src/proxy.conf.json.bak b/src/Web/WebSPA/Client/src/proxy.conf.json.bak new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/Web/WebSPA/Dockerfile b/src/Web/WebSPA/Dockerfile index 00ff8b3b55..10799128cb 100644 --- a/src/Web/WebSPA/Dockerfile +++ b/src/Web/WebSPA/Dockerfile @@ -20,6 +20,7 @@ WORKDIR /src # Create this "restore-solution" section by running ./Create-DockerfileSolutionRestore.ps1, to optimize build cache reuse COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index a8812bc940..f296ba8666 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -35,7 +35,15 @@ public void ConfigureServices(IServiceCollection services) }) .PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(Configuration["DPConnectionString"]), "DataProtection-Keys"); } - + services.AddCors(options => + { + options.AddPolicy("customPolicy", builder => + { + builder.AllowAnyOrigin() + .AllowAnyHeader() + .AllowAnyMethod(); + }); + }); // Add Antiforgery services and configure the header name that angular will use by default. services.AddAntiforgery(options => options.HeaderName = "X-XSRF-TOKEN"); @@ -102,6 +110,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF app.UseSpaStaticFiles(); } app.UseRouting(); + app.UseCors("customPolicy"); app.UseEndpoints(endpoints => { endpoints.MapDefaultControllerRoute(); diff --git a/src/Web/WebStatus/Dockerfile b/src/Web/WebStatus/Dockerfile index 47ecbd9e40..fa889e5822 100644 --- a/src/Web/WebStatus/Dockerfile +++ b/src/Web/WebStatus/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/Web/WebhookClient/Dockerfile b/src/Web/WebhookClient/Dockerfile index c259570295..d9a8d745c3 100644 --- a/src/Web/WebhookClient/Dockerfile +++ b/src/Web/WebhookClient/Dockerfile @@ -10,6 +10,7 @@ WORKDIR /src # to take advantage of Docker's build cache, to speed up local container builds COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" +COPY "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" "ApiGateways/Yarp/WebShoppingAPIGateway/WebShoppingAPIGateway.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" diff --git a/src/docker-compose.override.yml b/src/docker-compose.override.yml index 8251636e93..2d576b37fc 100644 --- a/src/docker-compose.override.yml +++ b/src/docker-compose.override.yml @@ -181,11 +181,18 @@ services: - "15200:8001" webshoppingapigw: - volumes: - - ./ApiGateways/Envoy/config/webshopping:/etc/envoy + environment: + - ASPNETCORE_ENVIRONMENT=Development + - IdentityUrl=http://identity-api + - CatalogUrlHC=http://catalog-api/hc + - OrderingUrlHC=http://ordering-api/hc + - IdentityUrlHC=http://identity-api/hc + - BasketUrlHC=http://basket-api/hc + - PaymentUrlHC=http://payment-api/hc + - IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 ports: - - "5202:80" - - "15202:8001" + - "5202:80" + - "15202:8001" mobileshoppingagg: environment: diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 3ae5d431aa..dd4e650d51 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -158,4 +158,7 @@ services: - webhooks-api webshoppingapigw: - image: envoyproxy/envoy:v1.11.1 + image: ${REGISTRY:-eshop}/webshoppingapigw:${PLATFORM:-linux}-${TAG:-latest} + build: + context: . + dockerfile: ApiGateways/Yarp/WebShoppingAPIGateway/Dockerfile \ No newline at end of file diff --git a/src/eShopOnContainers-ServicesAndWebApps.sln b/src/eShopOnContainers-ServicesAndWebApps.sln index 446614fc06..9c3ccf3a87 100644 --- a/src/eShopOnContainers-ServicesAndWebApps.sln +++ b/src/eShopOnContainers-ServicesAndWebApps.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29020.237 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32228.430 MinimumVisualStudioVersion = 10.0.40219.1 Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{FEA0C318-FFED-4D39-8781-265718CA43DD}" EndProject @@ -124,6 +124,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{373D8AA1 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventBus.Tests", "BuildingBlocks\EventBus\EventBus.Tests\EventBus.Tests.csproj", "{95D735BE-2899-4495-BE3F-2600E93B4E3C}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Yarp", "Yarp", "{E916275D-CDDB-4B43-9A40-43F223C65980}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebShoppingAPIGateway", "ApiGateways\Yarp\WebShoppingAPIGateway\WebShoppingAPIGateway.csproj", "{D5FD5EC0-7FA3-4417-A618-870E8721F66D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU @@ -1530,6 +1534,54 @@ Global {95D735BE-2899-4495-BE3F-2600E93B4E3C}.Release|x64.Build.0 = Release|Any CPU {95D735BE-2899-4495-BE3F-2600E93B4E3C}.Release|x86.ActiveCfg = Release|Any CPU {95D735BE-2899-4495-BE3F-2600E93B4E3C}.Release|x86.Build.0 = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|ARM.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|iPhone.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|x64.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|x64.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|x86.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.AppStore|x86.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|ARM.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|ARM.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|iPhone.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|x64.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|x64.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|x86.ActiveCfg = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Debug|x86.Build.0 = Debug|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|Any CPU.Build.0 = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|ARM.ActiveCfg = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|ARM.Build.0 = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|iPhone.ActiveCfg = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|iPhone.Build.0 = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|x64.ActiveCfg = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|x64.Build.0 = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|x86.ActiveCfg = Release|Any CPU + {D5FD5EC0-7FA3-4417-A618-870E8721F66D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1588,6 +1640,8 @@ Global {B62E859F-825E-4C8B-93EC-5966EACFD026} = {798BFC44-2CCD-45FA-B37A-5173B03C2B30} {373D8AA1-36BE-49EC-89F0-6CB736666285} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F} {95D735BE-2899-4495-BE3F-2600E93B4E3C} = {373D8AA1-36BE-49EC-89F0-6CB736666285} + {E916275D-CDDB-4B43-9A40-43F223C65980} = {77849D35-37D4-4802-81DC-9477B2775A40} + {D5FD5EC0-7FA3-4417-A618-870E8721F66D} = {E916275D-CDDB-4B43-9A40-43F223C65980} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9} From 062de66513d54008f2c5aecb9b538aa6fe491746 Mon Sep 17 00:00:00 2001 From: Tarun Jain Date: Thu, 12 May 2022 11:30:55 +0530 Subject: [PATCH 2/2] update appsettings and launchsettings --- .../Properties/launchSettings.json | 4 ++-- .../Yarp/WebShoppingAPIGateway/appsettings.json | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ApiGateways/Yarp/WebShoppingAPIGateway/Properties/launchSettings.json b/src/ApiGateways/Yarp/WebShoppingAPIGateway/Properties/launchSettings.json index bee9b2b49a..8f682293eb 100644 --- a/src/ApiGateways/Yarp/WebShoppingAPIGateway/Properties/launchSettings.json +++ b/src/ApiGateways/Yarp/WebShoppingAPIGateway/Properties/launchSettings.json @@ -4,7 +4,7 @@ "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:26551", - "sslPort": 44339 + "sslPort": 0 } }, "profiles": { @@ -29,7 +29,7 @@ "launchBrowser": true, "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", "publishAllPorts": true, - "useSSL": true + "useSSL": false } } } \ No newline at end of file diff --git a/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.json b/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.json index 0cdab786ef..c0cbfc4ce5 100644 --- a/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.json +++ b/src/ApiGateways/Yarp/WebShoppingAPIGateway/appsettings.json @@ -1,5 +1,5 @@ { - "Urls": "http://host.docker.internal:5202", + "Urls": "http://{ServiceHost}:{ServicePort}", "Logging": { "LogLevel": { "Default": "Information", @@ -11,7 +11,6 @@ "Routes": { "minimumroute": { "ClusterId": "minimumcluster", - "CorsPolicy": "customPolicy", "Match": { "Path": "{**catch-all}" } @@ -21,7 +20,7 @@ "CorsPolicy": "customPolicy", "Match": { "Methods": [ "GET", "POST" ], - "Hosts": "0.0.0.0", + "Hosts": "host.docker.internal", "Path": "/c/{**catch-all}" }, "Transforms": [ @@ -50,8 +49,13 @@ "Match": { "Methods": [ "GET", "POST" ], "Hosts": "host.docker.internal", - "Path": "/hub/notificationhub/{**catch-all}" - } + "Path": "/hub/{**catch-all}" + }, + "Transforms": [ + { + "PathRemovePrefix": "/hub" + } + ] }, "basket": { "ClusterId": "basket",