skantravels/services/AuthorizationService/Controllers/HealthCheckController.cs

21 lines
468 B
C#

using Microsoft.AspNetCore.Mvc;
namespace AuthorizationService.Controllers
{
[ApiController]
[Route("[controller]")]
public class HealthCheckController(AppDBContext context) : ControllerBase
{
[HttpGet(Name = "HealthCheck")]
public StatusCodeResult Get()
{
if (!context.Database.CanConnect())
{
return new StatusCodeResult(500);
}
return Ok();
}
}
}