@ofirdagan/pingdom
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,1 +0,1 @@ | ||
export declare function monitor(serviceName: string): void; | ||
export declare function monitor(serviceName: string, apiKey: string): void; |
@@ -9,10 +9,10 @@ "use strict"; | ||
const THREE_MIN = 1000 * 60 * 3; | ||
function monitor(serviceName) { | ||
reportAlive(serviceName); | ||
setInterval(() => reportAlive(serviceName), THREE_MIN); | ||
function monitor(serviceName, apiKey) { | ||
reportAlive(serviceName, apiKey); | ||
setInterval(() => reportAlive(serviceName, apiKey), THREE_MIN); | ||
} | ||
exports.monitor = monitor; | ||
function reportAlive(serviceName) { | ||
axios_1.default.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`); | ||
function reportAlive(serviceName, apiKey) { | ||
axios_1.default.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`, { headers: { 'x-api-key': apiKey } }); | ||
} | ||
//# sourceMappingURL=pingdom.js.map |
{ | ||
"name": "@ofirdagan/pingdom", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "my own lightweight version of pingdom (service monitoring)", | ||
@@ -5,0 +5,0 @@ "main": "dist/pingdom.js", |
@@ -5,9 +5,9 @@ import axios from 'axios'; | ||
export function monitor(serviceName: string) { | ||
reportAlive(serviceName); | ||
setInterval(() => reportAlive(serviceName), THREE_MIN); | ||
export function monitor(serviceName: string, apiKey: string) { | ||
reportAlive(serviceName, apiKey); | ||
setInterval(() => reportAlive(serviceName, apiKey), THREE_MIN); | ||
} | ||
function reportAlive(serviceName: string) { | ||
axios.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`); | ||
function reportAlive(serviceName: string, apiKey: string) { | ||
axios.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`, {headers: {'x-api-key': apiKey}}); | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3301