import RoverApi from "./roverApi.js"; const api = new RoverApi(); const body = document.getElementById("mainDivBody"); createBody(); setInterval(checkNewData, 3 * 1000); function checkNewData() { api.getRouteInfos(data => { body.innerText = JSON.stringify(data.infoObj, null, 2); }); } function createBody() { api.getRouteInfos(data => { body.innerHTML = JSON.stringify(data.infoObj, null, 2); }); }