added splitstat privacy

This commit is contained in:
Alex / Awex
2021-10-16 01:21:46 -04:00
parent e4273ae5aa
commit 055e76d646
2 changed files with 140 additions and 8 deletions
+7 -8
View File
@@ -1,13 +1,12 @@
async function checkForOutage() {
Global = {}
Global.error = false
await fetch(`https://api-splitstat.awexxx.xyz/heartbeat`).then(response => response.json()).catch(err => {
Global.error = true;
document.getElementById(`status`).innerText = `offline!`
document.getElementById(`addon`).innerText = `API returned nothing when sent a heartbeat.`
})
var data = await fetch(`https://st.awexxx.xyz/heartbeat`)
if (Global.error === false) {
console.log(data)
if (data.response !== 200) {
document.getElementById(`status`).innerText = `offline!`
document.getElementById(`addon`).innerText = `API didn't respond!`
} else if (data.response === 200) {
document.getElementById(`status`).innerText = `online!`
document.getElementById(`addon`).innerText = `API responded when sent a heartbeat!`
}