Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions EstateManagementUI.BusinessLogic.Tests/MediatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ private IConfigurationRoot SetupMemoryConfiguration()
configuration.Add("AppSettings:SecurityService", "http://127.0.0.1");
configuration.Add("AppSettings:MessagingServiceApi", "http://127.0.0.1");
configuration.Add("AppSettings:TransactionProcessorApi", "http://127.0.0.1");
configuration.Add("AppSettings:FileProcessorApi", "http://127.0.0.1");
configuration.Add("AppSettings:DatabaseEngine", "SqlServer");
configuration.Add("AppSettings:EstateReportingApi", "http://127.0.0.1");

Expand Down
20 changes: 20 additions & 0 deletions EstateManagementUI/Bootstrapper/MiddlewareRegistry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Lamar;
using Shared.Extensions;
using Shared.Middleware;
using System.Diagnostics.CodeAnalysis;

Expand All @@ -11,6 +12,25 @@
new RequestResponseMiddlewareLoggingConfig(LogLevel.Information, true, true);

this.AddSingleton(config);

this.AddHealthChecks().AddSecurityService(this.ApiEndpointHttpHandler).AddTransactionProcessorService(this.ApiEndpointHttpHandler)
.AddFileProcessorService(this.ApiEndpointHttpHandler);
}

private HttpClientHandler ApiEndpointHttpHandler(IServiceProvider serviceProvider)

Check warning on line 20 in EstateManagementUI/Bootstrapper/MiddlewareRegistry.cs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

EstateManagementUI/Bootstrapper/MiddlewareRegistry.cs#L20

Remove this unused method parameter 'serviceProvider'.
{
return new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (message,
cert,
chain,
errors) =>
{
return true;
}
};
}
}


}
7 changes: 6 additions & 1 deletion EstateManagementUI/EstateManagementUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Hydro" Version="1.2.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="9.0.0" />

<PackageReference Include="Hydro" Version="1.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.2" />
<PackageReference Include="Lamar" Version="15.0.0" />
Expand Down
14 changes: 14 additions & 0 deletions EstateManagementUI/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using Shared.Middleware;
using System.Diagnostics.CodeAnalysis;
using System.IdentityModel.Tokens.Jwt;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;

[ExcludeFromCodeCoverage]
public class Startup {
Expand Down Expand Up @@ -118,6 +120,18 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env,
{
endpoints.MapControllerRoute(name: "default", pattern: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapRazorPages();
endpoints.MapHealthChecks("health",
new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = Shared.HealthChecks.HealthCheckMiddleware.WriteResponse
});
endpoints.MapHealthChecks("healthui",
new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
});

app.PreWarm().Wait();
Expand Down
Loading