Node.js - two connections in Chrome and Safari?

I am trying to use this basic Javascript code in Node.js:

var count=1; var net = require('http'); net.createServer(function(req,res){ res.writeHead(200,{'Content-Type':'text/plain'}); res.end((count+=1).toString()); }).listen(3000,"127.0.0.1"); 

Expected Result : each step in the browser increases the number of samples by 1.

Actual result: Firefox increases by 1 (expected) ... Increment of Safari + Chrome by 2

A?

+4
source share
2 answers

Yes, as suggested, this is favicon.ico .

The following req.url time req.url before guessing :)

+6
source

I assume the answer is: favicon.ico

+2
source

Source: https://habr.com/ru/post/1340016/


All Articles