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);
@opichals started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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: