Commit ad8ffd78 authored by Johan Jatko's avatar Johan Jatko
Browse files

Update index.html, server.js files

parent e2019897
<!DOCTYPE html>
<html>
<head>
<title>Super demo cool stuff</title>
</head>
<body>
<h1>This is my awesome app</h1>
<h2>Latest api request was serverd from <span id="server">NOTHING</span></h2>
</body>
<script>
setTimeout(function() {
fetch("/api/gimmesome").then(function(response) {
server = document.querySelector("#server");
server.innerHTML = response;
});
}, 2000);
</script>
</html>
\ No newline at end of file
var http = require('http');
var os = require("os");
var hostname = os.hostname();
http.createServer(function (req, res) {
res.write(hostname);
res.end();
}).listen(5000);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment