master
Bryan 2020-12-20 10:29:05 -06:00
parent ea7cde069b
commit ff55c689db
1 changed files with 4 additions and 5 deletions

View File

@ -300,14 +300,13 @@
let delay = ""; let delay = "";
let apiKey = ""; let apiKey = "";
const unlockUrl = "https://ths.tnet.space/cgi-bin/unlock-main.cgi"; const unlockUrl = "https://ths.tnet.space/cgi-bin/unlock-main.cgi";
// const unlockUrl = "https://ths.tnet.space/cgi-bin/doorcontrol-cgi/test.cgi";
// make fetch function that calls cgi script with attributes (device id, api key, delay) // make fetch function that calls cgi script with attributes (device id, api key, delay)
const unlockDoor = (dID, aK, d) => { const unlockDoor = (dID, aK, d) => {
//fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`) fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`)
fetch(unlockUrl) // fetch(unlockUrl)
.then(response => response.text()) .then(response => response.json())
.then(data => messageContainer.innerHTML = data); .then(data => messageContainer.innerHTML = data.message);
} }
const setSettings = () => { const setSettings = () => {