Skip to content

Commit

Permalink
Create Liveness health check
Browse files Browse the repository at this point in the history
- for the endpoint /health
  • Loading branch information
sztrelcsikzoltan committed Jul 3, 2023
1 parent c7eafdd commit 8cc5d1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions InvestmentManager/InvestmentManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
builder.Services.AddStockIndexServiceHttpClientWithoutProfiler(stockIndexServiceUrl);
builder.Services.AddInvestmentManagerServices(stockIndexServiceUrl);

// Liveness healh check
builder.Services.AddHealthChecks();


var app = builder.Build();

// Configure the HTTP request pipeline.
Expand All @@ -68,6 +72,9 @@

app.UseAuthorization();

// Configure Liveness health check
app.UseEndpoints(endpoints => { endpoints.MapHealthChecks("/health"); });

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

0 comments on commit 8cc5d1d

Please sign in to comment.