function boards() { const paragraph = document.createElement("p"); paragraph.innerHTML=getBoards(); console.log("Calling the boards function......"); return paragraph; } function getBoards() { const responseText=""; var xhr = new XMLHttpRequest(); xhr.open("GET", "http://localhost:3000/api/boards/", true); xhr.setRequestHeader("Access-Control-Allow-Origin", "https://localhost:3000/") xhr.onload = function() { console.log(xhr.responseText); }; xhr.send(); console.log("Calling the getBoards function......"); console.log("Returning response text: $responseText"); return responseText; } export { boards }