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.
36 lines
868 B
36 lines
868 B
<script> |
|
function getAPI(){ |
|
|
|
fetch('http://localhost:3001/restricted') |
|
|
|
.then(function (res){ |
|
var hostname = 'HOSTNAME(container ID): ' + res.headers.get('HOSTNAME') |
|
console.log(hostname) |
|
res.json().then(function(data){ |
|
document.getElementById('output').innerHTML = JSON.stringify(data) |
|
document.getElementById('hostname').innerHTML = hostname |
|
console.log(JSON.stringify(data)) |
|
}) |
|
}) |
|
} |
|
</script> |
|
<html> |
|
<head> |
|
<meta charset="UTF-8"> </meta> |
|
</head> |
|
<body onload="getAPI()"> |
|
<div> |
|
<h1>SUCCESS</h1> |
|
</div> |
|
<div> |
|
<h2>YOU ARE LOGGED</h2> |
|
</div> |
|
<div> |
|
<h3>Access to resctricted content:</h3> |
|
<h3 id="output"></h3> |
|
</div> |
|
<div> |
|
<h3 id="hostname"></h3> |
|
</div> |
|
</body> |
|
</html> |