diff --git a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj index eb2eacb0a..442fa36a3 100644 --- a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj +++ b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj @@ -1,19 +1,18 @@  - $(NetCoreTargetVersion) + netcoreapp2.2 $(LangVersion) - - - - - - - - - + + + + + + + + diff --git a/src/ApiGateways/ApiGw-Base/Startup.cs b/src/ApiGateways/ApiGw-Base/Startup.cs index 8d52851b4..be845edca 100644 --- a/src/ApiGateways/ApiGw-Base/Startup.cs +++ b/src/ApiGateways/ApiGw-Base/Startup.cs @@ -89,19 +89,15 @@ namespace OcelotApiGw app.UseDeveloperExceptionPage(); } - app.UseRouting(); - app.UseEndpoints(endpoints => + app.UseHealthChecks("/hc", new HealthCheckOptions() { - endpoints.MapControllers(); - endpoints.MapHealthChecks("/hc", new HealthCheckOptions() - { - Predicate = _ => true, - ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse - }); - endpoints.MapHealthChecks("/liveness", new HealthCheckOptions - { - Predicate = r => r.Name.Contains("self") - }); + Predicate = _ => true, + ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse + }); + + app.UseHealthChecks("/liveness", new HealthCheckOptions + { + Predicate = r => r.Name.Contains("self") }); app.UseCors("CorsPolicy"); diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs index 986973f93..602477dde 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs @@ -50,7 +50,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator .AddDevspaces() .AddHttpServices(); - services.AddControllers(); + services.AddControllers().AddNewtonsoftJson(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -79,6 +79,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthentication(); + app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapDefaultControllerRoute(); diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs index 0b7790e36..257334aa3 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs @@ -51,7 +51,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator .AddDevspaces() .AddApplicationServices(); - services.AddControllers(); + services.AddControllers().AddNewtonsoftJson(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -77,6 +77,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator } app.UseAuthentication(); + app.UseAuthorization(); app.UseHttpsRedirection(); app.UseRouting(); app.UseEndpoints(endpoints =>