0
我从Node.js网站主页做出了示例脚本,像这样:Node.js示例给出2个响应?
var http = require('http');
http.createServer(function (req, res) {
console.log("We are connected");
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/');
任何想法,为什么each time I connect到127.0.0.1:1337(通过铬)我得到回应说:“我们正在连接”? ?
浏览器也发送favicon请求。 – 2013-03-20 15:02:48