diff --git a/tokenwatch-sync.js b/tokenwatch-sync.js index ab9a120..1d9758a 100644 --- a/tokenwatch-sync.js +++ b/tokenwatch-sync.js @@ -93,8 +93,11 @@ async function syncToTokenWatch(quotaData) { const postData = JSON.stringify(quotaData); // Ersetze diese URL durch die echte von TokenWatch auf der Jannik-Cloud, sobald sie läuft. const url = 'https://tokenwatch.orfel.de/api/webhook/antigravity'; + const isHttps = url.startsWith('https'); + const client = isHttps ? https : http; + return new Promise((resolve) => { - const req = http.request(url, { + const req = client.request(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(postData) } }, (res) => {