Reputation: 987
I have a simple HTTP server
require('http').createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World!');
console.log('Got a request');
}).listen(4000);
However, when I run it 'Got a request' is written 3 times in the console. Any idea why?
Upvotes: 1
Views: 3446
Reputation: 732
It's maybe your browser who try to get your favicon
You can confirm this by using : console.log('Got a request : ' + req.url);
Upvotes: 2