node.js 《Hello Wolrd》
hello_world.js
var http =require('http');
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Tpye': 'text/plain'});
response.end('Hello World\n');
}).listen(3000);
console.log('Server running at http://localhost:3000/');
执行:
node hello_world.js