diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs index 7a48e93eda..6523cafe98 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs @@ -64,9 +64,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF { app.UseDeveloperExceptionPage(); } - - - app.UseCors("CorsPolicy"); app.UseSwagger().UseSwaggerUI(c => { @@ -79,6 +76,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF }); app.UseRouting(); + app.UseCors("CorsPolicy"); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs index 27ee6db3e6..f9cd938198 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs @@ -64,9 +64,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF { app.UseDeveloperExceptionPage(); } - - - app.UseCors("CorsPolicy"); + app.UseHttpsRedirection(); app.UseSwagger().UseSwaggerUI(c => @@ -80,6 +78,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF }); app.UseRouting(); + app.UseCors("CorsPolicy"); app.UseAuthentication(); app.UseAuthorization(); diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index d9554bcb8c..e8576b238e 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -209,11 +209,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF }); app.UseRouting(); + app.UseCors("CorsPolicy"); ConfigureAuth(app); app.UseStaticFiles(); - - app.UseCors("CorsPolicy"); + app.UseEndpoints(endpoints => { endpoints.MapGrpcService(); diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 53a9554be6..836b6a7b81 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -82,9 +82,9 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF { c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Catalog.API V1"); }); - - app.UseCors("CorsPolicy"); + app.UseRouting(); + app.UseCors("CorsPolicy"); app.UseEndpoints(endpoints => { endpoints.MapDefaultControllerRoute(); diff --git a/src/Services/Location/Locations.API/Startup.cs b/src/Services/Location/Locations.API/Startup.cs index 4f79b8977f..ca6a57e6e5 100644 --- a/src/Services/Location/Locations.API/Startup.cs +++ b/src/Services/Location/Locations.API/Startup.cs @@ -168,9 +168,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF app.UsePathBase(pathBase); } - app.UseCors("CorsPolicy"); - app.UseRouting(); + app.UseCors("CorsPolicy"); ConfigureAuth(app); app.UseEndpoints(endpoints => diff --git a/src/Services/Marketing/Marketing.API/Startup.cs b/src/Services/Marketing/Marketing.API/Startup.cs index 4c2c2a710d..a7386a5323 100644 --- a/src/Services/Marketing/Marketing.API/Startup.cs +++ b/src/Services/Marketing/Marketing.API/Startup.cs @@ -163,10 +163,9 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF { app.UsePathBase(pathBase); } - - app.UseCors("CorsPolicy"); + app.UseRouting(); - + app.UseCors("CorsPolicy"); ConfigureAuth(app); app.UseEndpoints(endpoints => diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index 3ccf16d548..a8da9a35c7 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -89,8 +89,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF app.UsePathBase(pathBase); } - app.UseCors("CorsPolicy"); - app.UseSwagger() .UseSwaggerUI(c => { @@ -100,6 +98,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF }); app.UseRouting(); + app.UseCors("CorsPolicy"); ConfigureAuth(app); app.UseEndpoints(endpoints => diff --git a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs index cec48c4d2a..a20a1a1969 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs @@ -133,10 +133,9 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) loggerFactory.CreateLogger().LogDebug("Using PATH BASE '{pathBase}'", pathBase); app.UsePathBase(pathBase); } - - app.UseCors("CorsPolicy"); + app.UseRouting(); - + app.UseCors("CorsPolicy"); app.UseAuthentication(); app.UseAuthorization(); diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index 7833133d5a..c8073e1a0c 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -78,9 +78,10 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) app.UsePathBase(pathBase); } - app.UseCors("CorsPolicy"); + app.UseRouting(); + app.UseCors("CorsPolicy"); ConfigureAuth(app); app.UseEndpoints(endpoints =>