var http = require("http"); var serv = http.createServer( function (req, res) { console.log("ping !"); res.writeHead(200, { "Content-Type": "text/plain" }); res.write("Hello world !"); res.end(); } ); serv.listen(8080); console.log("Server running at http://localhost:8080");