Basic fetch example
HTML
<input type="button" id="basicFetchButton" value="Try it">
JavaScript
document.getElementById("basicFetchButton").addEventListener("click", function(){
// Loading the jQuery code
fetch("http://localhost:3000/graph/graphData")
.then(function (response) {
response.text().then(function (responseText) {
console.log(typeof responseText);
alert("Done using Fetch!");
});
});
});