mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 02:28:31 +01:00
31 lines
831 B
C#
31 lines
831 B
C#
using BTCPayServer.Client.Models;
|
|
using BTCPayServer.HostedServices;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Cors;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace BTCPayServer.Controllers.Greenfield
|
|
{
|
|
[Controller]
|
|
[EnableCors(CorsPolicies.All)]
|
|
public class GreenfieldHealthController : ControllerBase
|
|
{
|
|
private readonly NBXplorerDashboard _dashBoard;
|
|
|
|
public GreenfieldHealthController(NBXplorerDashboard dashBoard)
|
|
{
|
|
_dashBoard = dashBoard;
|
|
}
|
|
[AllowAnonymous]
|
|
[HttpGet("~/api/v1/health")]
|
|
public ActionResult GetHealth()
|
|
{
|
|
ApiHealthData model = new ApiHealthData()
|
|
{
|
|
Synchronized = _dashBoard.IsFullySynched()
|
|
};
|
|
return Ok(model);
|
|
}
|
|
}
|
|
}
|