diff --git a/BervProject.WebApi.Boilerplate/BervProject.WebApi.Boilerplate.csproj b/BervProject.WebApi.Boilerplate/BervProject.WebApi.Boilerplate.csproj
index d735688e..f06d6135 100644
--- a/BervProject.WebApi.Boilerplate/BervProject.WebApi.Boilerplate.csproj
+++ b/BervProject.WebApi.Boilerplate/BervProject.WebApi.Boilerplate.csproj
@@ -45,6 +45,9 @@
+
+
+
diff --git a/BervProject.WebApi.Boilerplate/Program.cs b/BervProject.WebApi.Boilerplate/Program.cs
index fe3530e0..373b6187 100644
--- a/BervProject.WebApi.Boilerplate/Program.cs
+++ b/BervProject.WebApi.Boilerplate/Program.cs
@@ -19,6 +19,7 @@
using NLog.Web;
var builder = WebApplication.CreateBuilder(args);
+builder.AddServiceDefaults();
builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
builder.Logging.ClearProviders();
builder.Logging.SetMinimumLevel(LogLevel.Trace);
@@ -54,7 +55,6 @@
});
builder.Services.AddDbContext(options => options.UseNpgsql(builder.Configuration.GetConnectionString("BoilerplateConnectionString")));
-builder.Services.AddHealthChecks();
builder.Services.AddControllers();
builder.Services.AddApiVersioning();
builder.Services.AddSwaggerGen(options =>
@@ -101,8 +101,6 @@
app.UseAuthorization();
-app.MapHealthChecks("/healthz");
-
app.UseSwagger(c =>
{
c.RouteTemplate = "api/docs/{documentName}/swagger.json";
@@ -114,6 +112,8 @@
c.RoutePrefix = "api/docs";
});
+app.MapDefaultEndpoints();
+
app.MapControllers();
app.MapHangfireDashboard();
diff --git a/BervProject.WebApi.Integration.Test/HealthCheckTest.cs b/BervProject.WebApi.Integration.Test/HealthCheckTest.cs
index bc18b520..5eff2cc7 100644
--- a/BervProject.WebApi.Integration.Test/HealthCheckTest.cs
+++ b/BervProject.WebApi.Integration.Test/HealthCheckTest.cs
@@ -15,7 +15,7 @@ public HealthCheckTest(WebAppFixture webAppFixtures)
public async Task SuccessCheck()
{
var client = _applicationFactory.CreateClient();
- var response = await client.GetAsync("/healthz");
+ var response = await client.GetAsync("/health");
Assert.True(response.IsSuccessStatusCode);
var stringResponse = await response.Content.ReadAsStringAsync();
Assert.Equal("Healthy", stringResponse);