Answer the question
In order to leave comments, you need to log in
Does the http.createServer body fire twice in a row?
Good evening gentlemen.
I returned to node after a long time and decided to start my local server, but I encountered the fact that when the page is reloaded, the body in the http.createServer() function fires twice in a row, what could be the problem?
Answer the question
In order to leave comments, you need to log in
probably because the browser makes 2 requests, once it asks for the page, and the second time it asks for a favicon
(this can be checked in the browser in the developer console)
I quickly found a crutch on Google for this second request
https://gist.github.com/ kentbrew/763822
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question