uptime-kuma/extra/push-examples/javascript-fetch/index.js

13 lines
298 B
JavaScript
Raw Normal View History

// Supports: Node.js >= 18, Deno, Bun
2023-09-13 12:03:12 +00:00
const pushURL = "https://example.com/api/push/key?status=up&msg=OK&ping=";
const interval = 60;
2024-05-23 15:42:36 +00:00
const method = "GET";
2023-09-13 12:03:12 +00:00
const push = async () => {
2024-05-23 15:42:36 +00:00
await fetch(pushURL, { method });
2023-09-13 12:03:12 +00:00
console.log("Pushed!");
};
push();
setInterval(push, interval * 1000);