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
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BervProject.WebApi.Boilerplate.ServiceDefaults\BervProject.WebApi.Boilerplate.ServiceDefaults.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="nlog.config" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions BervProject.WebApi.Boilerplate/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using NLog.Web;

var builder = WebApplication.CreateBuilder(args);
builder.AddServiceDefaults();

Check warning on line 22 in BervProject.WebApi.Boilerplate/Program.cs

View check run for this annotation

Codecov / codecov/patch

BervProject.WebApi.Boilerplate/Program.cs#L22

Added line #L22 was not covered by tests
builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
builder.Logging.ClearProviders();
builder.Logging.SetMinimumLevel(LogLevel.Trace);
Expand Down Expand Up @@ -54,7 +55,6 @@
});
builder.Services.AddDbContext<BoilerplateDbContext>(options => options.UseNpgsql(builder.Configuration.GetConnectionString("BoilerplateConnectionString")));

builder.Services.AddHealthChecks();
builder.Services.AddControllers();
builder.Services.AddApiVersioning();
builder.Services.AddSwaggerGen(options =>
Expand Down Expand Up @@ -101,8 +101,6 @@

app.UseAuthorization();

app.MapHealthChecks("/healthz");

app.UseSwagger(c =>
{
c.RouteTemplate = "api/docs/{documentName}/swagger.json";
Expand All @@ -114,6 +112,8 @@
c.RoutePrefix = "api/docs";
});

app.MapDefaultEndpoints();

Check warning on line 115 in BervProject.WebApi.Boilerplate/Program.cs

View check run for this annotation

Codecov / codecov/patch

BervProject.WebApi.Boilerplate/Program.cs#L115

Added line #L115 was not covered by tests

app.MapControllers();
app.MapHangfireDashboard();

Expand Down
2 changes: 1 addition & 1 deletion BervProject.WebApi.Integration.Test/HealthCheckTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading