Commit 047e8a77 authored by SupunGurusinghe's avatar SupunGurusinghe

updated script

parent 415d7162
......@@ -30,3 +30,21 @@ $(document).ready(function () {
}
});
});
async function getRequest(url = '') {
const response = await fetch(url, {
method: 'GET',
cache: 'no-cache'
})
return response.json()
}
document.addEventListener('DOMContentLoaded', function () {
let url = document.location
let route = "/flaskwebgui-keep-server-alive"
let interval_request = 3 * 1000 //sec
function keep_alive_server() {
getRequest(url + route)
.then(data => console.log(data))
}
setInterval(keep_alive_server, interval_request)()
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment