diff --git a/src/autostake/Health.mjs b/src/autostake/Health.mjs index dffc6785..90c4d110 100644 --- a/src/autostake/Health.mjs +++ b/src/autostake/Health.mjs @@ -7,6 +7,7 @@ class Health { const { address, uuid, name, apiKey, timeout, gracePeriod } = config || {} const { dryRun, networkName } = opts || {} this.address = address || 'https://hc-ping.com' + this.apiAddress = apiAddress || 'https://healthchecks.io' this.name = name || networkName this.gracePeriod = gracePeriod || 86400 // default 24 hours this.timeout = timeout || 86400 // default 24 hours @@ -18,7 +19,7 @@ class Health { if (address) { // This is necessary as the default provider - hc-ping.com - has a built in ping mechanism - // whereas providing self-hosted addresses do NOT. + // whereas providing self-hosted addresses do NOT. // https://healthchecks.selfhosted.com/ping/{uuid} rather than https://hc-ping.com/{uuid} this.address = this.address + "/ping" } @@ -65,7 +66,7 @@ class Health { } try { - await axios.post([this.address, 'api/v2/checks/'].join('/'), data, config).then((res) => { + await axios.post([this.apiAddress, 'api/v2/checks/'].join('/'), data, config).then((res) => { this.uuid = res.data.ping_url.split('/')[4] }); } catch (error) { @@ -92,4 +93,4 @@ class Health { } } -export default Health \ No newline at end of file +export default Health