Adding API Health Check (#191)

This commit is contained in:
Steve Smith
2019-01-18 11:48:26 -05:00
committed by GitHub
parent e41e37ff05
commit 483340f21e
4 changed files with 70 additions and 4 deletions

View File

@@ -19,7 +19,9 @@ namespace Microsoft.eShopWeb.Web.HealthChecks
HealthCheckContext context,
CancellationToken cancellationToken = default(CancellationToken))
{
string myUrl = _httpContextAccessor.HttpContext.Request.Host.ToString();
var request = _httpContextAccessor.HttpContext.Request;
string myUrl = request.Scheme + "://" + request.Host.ToString();
var client = new HttpClient();
var response = await client.GetAsync(myUrl);
var pageContents = await response.Content.ReadAsStringAsync();