nodejs hangs with express static files nodejs hangs with express static files express express

nodejs hangs with express static files


There is something not quite right about that http request. I recommend using the request module for this sort of thing. Either way this works:

var http = require('http');var express = require('express');var app = express.createServer();app.configure(function(){  app.use(express.logger({ format: '\x1b[1m:method\x1b[0m \x1b[33m:url\x1b[0m :response-time ms' }));  app.use(express.bodyParser());  app.use(express['static'](__dirname + '/public')); //Comment me and all works perfectly!})app.listen(51783);var request = require('request');setTimeout(function(){  console.log('Server Now Unresponsive but requests queued');  [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].forEach(function(item){    request('http://www.google.com', function (error, response, body) {        console.log("request number "+item+" received")    })  });},5000);