let http = require('http');
let PORT = 3000;

function requestListener(request, response) {
    console.log("Server: I received a request for ", request.url);
    response.writeHead(200, {'Content-Type': 'text/html'}); // OK status and html text response
    response.write("<h1>Hello, from the server</h1>");      // html text body to send back
    response.end();                                         // send the response now
}

http.createServer(requestListener).listen(PORT);
console.log(`Server running at http://localhost:${PORT}/`);