我正在尝试学习node.js和许多其他人一样,第一步就像How to run server written in js with Node.js
但是,我的问题是语法问题? (如下)
server.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');