API: Add health check endpoint

This commit is contained in:
Dennis Reimann
2020-04-16 15:39:08 +02:00
parent 0a1a4fd3b5
commit 3bd5c3e1b5
4 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace BTCPayServer.Client
{
public partial class BTCPayServerClient
{
public virtual async Task<bool> IsHealthy(CancellationToken token = default)
{
var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/health"), token);
return response.IsSuccessStatusCode;
}
}
}