nodejs – http.createServer seems to call twice

That is normal – your browser makes more than one call.

Most browsers make a call to grab /favicon.ico for example.

Try to log the url:

console.log(req.url);

and you’ll see what’s being called.

Leave a Comment