mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-17 10:40:35 -04:00
Push Examples (#3735)
This commit is contained in:
parent
9c24cd3973
commit
9ef1e69ae0
13 changed files with 178 additions and 0 deletions
10
extra/push-examples/javascript-fetch/index.js
Normal file
10
extra/push-examples/javascript-fetch/index.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
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);
|
5
extra/push-examples/javascript-fetch/package.json
Normal file
5
extra/push-examples/javascript-fetch/package.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"scripts": {
|
||||
"start": "node index.js"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue