I trying to find my way into node.js transfering a local sports statistics application written in c#.
Writing the http server, i observe that every time i refresh (after the first time) the server to make a new request, i have 2 response.
I strip the code to eliminate every other possible cause and the "problem" still exists.
Code
var http = require("http");
var counter = 0;
var port = process.env.PORT || 3000;
var requestListener = function (req, res) {
counter += 1;
res.end("Hits: "+ counter);
};
var server = http.createServer(requestListener);
server.listen(port, function (err) {
console.log("server listen on port " + port);
});
Is this the normal behaviour or i missing something?