You are reading a single comment by @opichals and its replies. Click here to read the full conversation.
  • Hi @cmo!

    I am affraid that listen() returns nothing (unlike the node.js' one). I have submitted a new bug for this.

    In the meantime the code would need to look as follows:

    var http = require('http');
    var server=http.createServer(function(req, res){
            res.writeHead(200);
            res.end("Hello World");
            console.log("res sent");
    });
    server.listen(80);
    setTimeout(function(){
            server.close();
    },5000);
    
About

Avatar for opichals @opichals started