summaryrefslogtreecommitdiffstats
path: root/extra/push-examples/javascript-fetch/index.js
blob: 9d21d0db82f0b0b51bd2335ffa595c8a29ce375d (plain)
1
2
3
4
5
6
7
8
9
10
11
// Supports: Node.js >= 18, Deno, Bun
const pushURL = "https://example.com/api/push/key?status=up&msg=OK&ping=";
const interval = 60;

const push = async () => {
    await fetch(pushURL);
    console.log("Pushed!");
};

push();
setInterval(push, interval * 1000);