add server.js

parent aab1b82a
Pipeline #24170 passed with stages
in 3 minutes and 28 seconds
const http = require('http');
const os = require('os');
var handleRequest = function(request, response) {
var now = new Date().toLocaleString();
console.log('Received request for URL: ' + request.url);
response.writeHead(200);
response.end('Hello World!\nIt is now '+ now + ' at ' + os.hostname() );
};
var www = http.createServer(handleRequest);
www.listen(8080);
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