init(); async function init() { display(await get()) } async function get() { var url = `${window.location.origin}/api/v1/list/hits`; var resp = await fetch(url); return await resp.json(); } async function display(data) { document.getElementById('server_host').textContent = `HOST: ${data.host}`; let dat = data.dat[0] console.log(JSON.stringify(dat)) document.getElementById('time').textContent = `COUNTER START TIME: ${dat.since}`; document.getElementById('ldbws').textContent = dat.ldbws || "0"; document.getElementById('ldbsvws').textContent = dat.ldbsvws || "0"; }