http.createServer(function(request, response) { console.log("New request :"+request.url); var found = false; for(var i= 0; i < requests.length; i++){ match = requests[i]; if(match.method == request.method && request.url.match(match.regexp)) { console.log("Matched request: "+match.url); pg.connect(databaseUrl, function(error, client) { if(error) processError(response, error); else match.action(client, request, response); }); found = true; break; } } if(!found) processError(response, "Request url does not exist: "+request.url); }).listen(3000); sys.puts("Server running... waiting for requests");
Hello everybody. I am stuck in this code. Whenever I call the same request 11 times, nodejs stops responding and does not even register "New request:" + request.url. Does anyone have an idea of ββwhat is going on?
Many thanks.
source share