I am trying to create a simple node js server that print 'new client' when any one open the server URL. This is my code
var http = require('http'); var server = http.createServer(); server.on('request', function(req, res){ res.end('hello world'); console.log('new client'); }); server.listen(8080); but when i open the http://localhost:8080 the console output 'new client' two times, it should be one line, is this normal?