Skip to content

Instantly share code, notes, and snippets.

@PatrickKalkman
Created June 20, 2021 16:15
Show Gist options
  • Save PatrickKalkman/6aec52bf57c718364eef8e24d1df0ae5 to your computer and use it in GitHub Desktop.
Save PatrickKalkman/6aec52bf57c718364eef8e24d1df0ae5 to your computer and use it in GitHub Desktop.
Controller that receives the health check request
[ApiController]
[Route("[controller]")]
public class HealthCheckController : ControllerBase
{
private readonly ILogger<HealthCheckController> _logger;
public HealthCheckController(ILogger<HealthCheckController> logger)
{
_logger = logger;
}
[HttpGet]
public IActionResult HealthCheck()
{
// Check the health of your application
// e.g. perform query on the database and map the result
return Ok();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment