fix: update some examples

This commit is contained in:
Stefan Ottosson 2024-05-23 17:42:36 +02:00
parent 1ac5696463
commit b2ede38269
No known key found for this signature in database
GPG key ID: 254BFA8856A90692
2 changed files with 4 additions and 2 deletions

View file

@ -2,9 +2,10 @@
# Filename: index.sh # Filename: index.sh
PUSH_URL="https://example.com/api/push/key?status=up&msg=OK&ping=" PUSH_URL="https://example.com/api/push/key?status=up&msg=OK&ping="
INTERVAL=60 INTERVAL=60
HTTP_METHOD="GET"
while true; do while true; do
curl -s -o /dev/null $PUSH_URL curl -X $HTTP_METHOD -s -o /dev/null $PUSH_URL
echo "Pushed!" echo "Pushed!"
sleep $INTERVAL sleep $INTERVAL
done done

View file

@ -1,9 +1,10 @@
// Supports: Node.js >= 18, Deno, Bun // Supports: Node.js >= 18, Deno, Bun
const pushURL = "https://example.com/api/push/key?status=up&msg=OK&ping="; const pushURL = "https://example.com/api/push/key?status=up&msg=OK&ping=";
const interval = 60; const interval = 60;
const method = "GET";
const push = async () => { const push = async () => {
await fetch(pushURL); await fetch(pushURL, { method });
console.log("Pushed!"); console.log("Pushed!");
}; };