Skip to content

Commit

Permalink
Health check project added
Browse files Browse the repository at this point in the history
  • Loading branch information
ebubekirdinc committed Mar 13, 2023
1 parent cf01210 commit 0ff88df
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/WebApps/HealthCheck/HealthCheck.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="6.0.5" />
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="6.0.5" />
</ItemGroup>

</Project>
24 changes: 24 additions & 0 deletions src/WebApps/HealthCheck/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllersWithViews();

builder.Services.AddHealthChecksUI()
.AddInMemoryStorage();

var app = builder.Build();

app.UseRouting();

app.UseAuthorization();

app.UseEndpoints(endpoints =>
{
endpoints.MapHealthChecksUI();

endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});

app.Run();

21 changes: 21 additions & 0 deletions src/WebApps/HealthCheck/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:57370",
"sslPort": 44396
}
},
"profiles": {
"HealthCheck": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:5100",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
8 changes: 8 additions & 0 deletions src/WebApps/HealthCheck/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
52 changes: 52 additions & 0 deletions src/WebApps/HealthCheck/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"HealthChecks-UI": {
"HealthChecks": [
{
"Name": "Identity Health Check",
"Uri": "https://localhost:5001/hc"
},
{
"Name": "Assessment Health Check",
"Uri": "https://localhost:5002/hc"
},
{
"Name": "Account Health Check",
"Uri": "https://localhost:5004/hc"
},
{
"Name": "Subscription Health Check",
"Uri": "https://localhost:5006/hc"
},
{
"Name": "Payment Health Check",
"Uri": "https://localhost:5008/hc"
},

{
"Name": "Notification Health Check",
"Uri": "https://localhost:5012/hc"
},
{
"Name": "Ordering Health Check",
"Uri": "https://localhost:5014/hc"
}
],
"Webhooks": [
{
"Name": "",
"Uri": "",
"Payload": "",
"RestoredPayload": ""
}
],
"EvaluationTimeOnSeconds": 10,
"MinimumSecondsBetweenFailureNotifications": 60
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

0 comments on commit 0ff88df

Please sign in to comment.