NodeJS server incrementing variable by two for every request

后端 未结 1 364
被撕碎了的回忆
被撕碎了的回忆 2021-01-04 09:29

When this code is run, i is incremented by two every time and I can\'t pinpoint in the documentation or otherwise why this would be the case. I\'d expect the in

相关标签:
1条回答
  • 2021-01-04 10:09

    console.log(req.url);

    You will notice the urls are / and /favicon.ico

    Browsers like making requests to favicon.ico for you. That's why you get 2 requests.

    0 讨论(0)
提交回复
热议问题