Skip to content

Commit 1c88396

Browse files
committed
return ocelote to 2.2 for incompatibility of 3.0
1 parent cb94259 commit 1c88396

4 files changed

Lines changed: 21 additions & 24 deletions

File tree

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
<LangVersion>$(LangVersion)</LangVersion>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="$(AspNetCore_HealthChecks_UI_Client)" />
10-
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="$(AspNetCore_HealthChecks_Uris)" />
11-
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="$(Microsoft_AspNetCore_Diagnostics_HealthChecks)" />
12-
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="$(Microsoft_AspNetCore_HealthChecks)" />
13-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="$(Microsoft_AspNetCore_Mvc_Formatters_Json)" />
14-
<PackageReference Include="Ocelot" Version="$(Ocelot)" />
15-
<PackageReference Include="Serilog.AspNetCore" Version="$(Serilog_AspNetCore)" />
16-
<PackageReference Include="Serilog.Sinks.Console" Version="$(Serilog_Sinks_Console)" />
17-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(Microsoft_AspNetCore_Authentication_JwtBearer)" />
9+
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="2.2.2" />
10+
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="2.2.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
13+
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
14+
<PackageReference Include="Ocelot" Version="12.0.1" />
15+
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
16+
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
1817
</ItemGroup>
1918
</Project>

src/ApiGateways/ApiGw-Base/Startup.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,15 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
8989
app.UseDeveloperExceptionPage();
9090
}
9191

92-
app.UseRouting();
93-
app.UseEndpoints(endpoints =>
92+
app.UseHealthChecks("/hc", new HealthCheckOptions()
9493
{
95-
endpoints.MapControllers();
96-
endpoints.MapHealthChecks("/hc", new HealthCheckOptions()
97-
{
98-
Predicate = _ => true,
99-
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
100-
});
101-
endpoints.MapHealthChecks("/liveness", new HealthCheckOptions
102-
{
103-
Predicate = r => r.Name.Contains("self")
104-
});
94+
Predicate = _ => true,
95+
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
96+
});
97+
98+
app.UseHealthChecks("/liveness", new HealthCheckOptions
99+
{
100+
Predicate = r => r.Name.Contains("self")
105101
});
106102

107103
app.UseCors("CorsPolicy");

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void ConfigureServices(IServiceCollection services)
5050
.AddDevspaces()
5151
.AddHttpServices();
5252

53-
services.AddControllers();
53+
services.AddControllers().AddNewtonsoftJson();
5454
}
5555

5656
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -79,6 +79,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
7979
app.UseHttpsRedirection();
8080
app.UseRouting();
8181
app.UseAuthentication();
82+
app.UseAuthorization();
8283
app.UseEndpoints(endpoints =>
8384
{
8485
endpoints.MapDefaultControllerRoute();

src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void ConfigureServices(IServiceCollection services)
5151
.AddDevspaces()
5252
.AddApplicationServices();
5353

54-
services.AddControllers();
54+
services.AddControllers().AddNewtonsoftJson();
5555
}
5656

5757
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -77,6 +77,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
7777
}
7878

7979
app.UseAuthentication();
80+
app.UseAuthorization();
8081
app.UseHttpsRedirection();
8182
app.UseRouting();
8283
app.UseEndpoints(endpoints =>

0 commit comments

Comments
 (0)