Created
November 23, 2022 21:15
-
-
Save JuergenGutsch/c11ae11db266f033c04817f2f68f5e51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace RoutingSample; | |
public static class MapMyHealthChecksExtensions | |
{ | |
public static IEndpointConventionBuilder MapMyHealthChecks( | |
this IEndpointRouteBuilder endpoints, string pattern = "/myhealth") | |
{ | |
var pipeline = endpoints | |
.CreateApplicationBuilder() | |
.UseMiddleware<MyHealthChecksMiddleware>() | |
.Build(); | |
return endpoints.Map(pattern, pipeline) | |
.WithDisplayName("My custom health checks"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment