Docker containers running sample nodejs app among others tools for learning purposes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
772 B

<script>
function getAPI(){
fetch('http://localhost:3001/')
.then(function (res){
res.json().then(function(data){
document.getElementById('output').innerHTML = JSON.stringify(data);
console.log(JSON.stringify(data));
console.log(JSON.stringify(data, ['message']));
console.log('why, though');
console.log(Object.values(data));
console.log(Object.keys(data));
})
})
}
</script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body onload="getAPI()">
<h1>HTML calling REST API</h1>
<div id="output"></div>
</body>
</html>