Skip to content

Commit

Permalink
Refactor health check response writer to new class
Browse files Browse the repository at this point in the history
Moved WriteResponse method from ConfigureEndpoints to new PingEndpoint class.
Updated Program.cs to reference PingEndpoint.WriteResponse.
Created PingEndpoint.cs with WriteResponse method.
Removed WriteResponse method from ConfigureEndpoints.
  • Loading branch information
EdiWang committed Nov 17, 2024
1 parent c4e9574 commit 655db28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Moonglade.Web.Configuration;

public class ConfigureEndpoints
public class PingEndpoint
{
public static Task WriteResponse(HttpContext context, HealthReport result)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Moonglade.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ private static void ConfigureMiddleware(WebApplication app, List<CultureInfo> cu

app.MapHealthChecks("/ping", new()
{
ResponseWriter = ConfigureEndpoints.WriteResponse
ResponseWriter = PingEndpoint.WriteResponse
});
app.MapControllers();
app.MapRazorPages();
Expand Down

0 comments on commit 655db28

Please sign in to comment.