File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
BervProject.WebApi.Boilerplate
BervProject.WebApi.Integration.Test Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 4545 <PackageReference Include =" Swashbuckle.AspNetCore" Version =" 8.1.1" />
4646 </ItemGroup >
4747
48+ <ItemGroup >
49+ <ProjectReference Include =" ..\BervProject.WebApi.Boilerplate.ServiceDefaults\BervProject.WebApi.Boilerplate.ServiceDefaults.csproj" />
50+ </ItemGroup >
4851 <ItemGroup >
4952 <Content Update =" nlog.config" CopyToOutputDirectory =" PreserveNewest" />
5053 </ItemGroup >
Original file line number Diff line number Diff line change 1919using NLog . Web ;
2020
2121var builder = WebApplication . CreateBuilder ( args ) ;
22+ builder . AddServiceDefaults ( ) ;
2223builder . Host . UseServiceProviderFactory ( new AutofacServiceProviderFactory ( ) ) ;
2324builder . Logging . ClearProviders ( ) ;
2425builder . Logging . SetMinimumLevel ( LogLevel . Trace ) ;
5455} ) ;
5556builder . Services . AddDbContext < BoilerplateDbContext > ( options => options . UseNpgsql ( builder . Configuration . GetConnectionString ( "BoilerplateConnectionString" ) ) ) ;
5657
57- builder . Services . AddHealthChecks ( ) ;
5858builder . Services . AddControllers ( ) ;
5959builder . Services . AddApiVersioning ( ) ;
6060builder . Services . AddSwaggerGen ( options =>
101101
102102app . UseAuthorization ( ) ;
103103
104- app . MapHealthChecks ( "/healthz" ) ;
105-
106104app . UseSwagger ( c =>
107105{
108106 c . RouteTemplate = "api/docs/{documentName}/swagger.json" ;
114112 c . RoutePrefix = "api/docs" ;
115113} ) ;
116114
115+ app . MapDefaultEndpoints ( ) ;
116+
117117app . MapControllers ( ) ;
118118app . MapHangfireDashboard ( ) ;
119119
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public HealthCheckTest(WebAppFixture webAppFixtures)
1515 public async Task SuccessCheck ( )
1616 {
1717 var client = _applicationFactory . CreateClient ( ) ;
18- var response = await client . GetAsync ( "/healthz " ) ;
18+ var response = await client . GetAsync ( "/health " ) ;
1919 Assert . True ( response . IsSuccessStatusCode ) ;
2020 var stringResponse = await response . Content . ReadAsStringAsync ( ) ;
2121 Assert . Equal ( "Healthy" , stringResponse ) ;
You can’t perform that action at this time.
0 commit comments