File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -215,7 +215,9 @@ await scope.ServiceProvider
215215// API controllers
216216builder . Services
217217 . AddControllersWithViews ( ) // WithViews is needed to use the ValidateAntiForgeryToken attribute
218- . AddJsonOptions ( o => o . JsonSerializerOptions . ConfigureForNodaTime ( DateTimeZoneProviders . Tzdb ) ) ;
218+ . AddJsonOptions ( o => o . JsonSerializerOptions . ConfigureForNodaTime ( DateTimeZoneProviders . Tzdb ) ) ;
219+
220+ builder . Services . AddHealthChecks ( ) . AddDbContextCheck < Db > ( ) ;
219221
220222builder . Services . AddHttpContextAccessor ( ) ;
221223
@@ -285,6 +287,7 @@ await scope.ServiceProvider
285287} ) ;
286288
287289app . MapStaticAssets ( ) ;
290+ app . MapHealthChecks ( "/healthz" ) ;
288291app . MapControllers ( ) ;
289292app . MapRazorComponents < App > ( )
290293 . AddInteractiveServerRenderMode ( )
Original file line number Diff line number Diff line change 2626 <PackageReference Include =" Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version =" 10.0.1" />
2727 <PackageReference Include =" Microsoft.EntityFrameworkCore.Design" Version =" 10.0.1" PrivateAssets =" all" IncludeAssets =" runtime; build; native; analyzers" />
2828 <PackageReference Include =" Microsoft.EntityFrameworkCore.Sqlite" Version =" 10.0.1" />
29+ <PackageReference Include =" Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version =" 10.0.4" />
2930 <PackageReference Include =" NodaTime" Version =" 3.2.3" />
3031 <PackageReference Include =" NodaTime.Serialization.SystemTextJson" Version =" 1.3.0" />
3132 <PackageReference Include =" Npgsql.EntityFrameworkCore.PostgreSQL" Version =" 10.0.0" />
You can’t perform that action at this time.
0 commit comments