R
R
RusTaylor2019-06-05 22:59:38
Node.js
RusTaylor, 2019-06-05 22:59:38

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

1 answer(s)
H
hzzzzl, 2019-06-05
@RusTaylor

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 question

Ask a Question

731 491 924 answers to any question