Using vhost - non-existing routes do not show 404, never time out #81

Open
ragulka opened this Issue Mar 21, 2013 · 1 comment

1 participant

@ragulka

I am trying to set up Locomotive with wildcard subdomains using express vhost but I'm stuck. It seems that I can get the routes to work, but when I hit a route that does not exist, I do not get a 404 like I used to, but instead I am stuck in a forever-lasting request. There even isn't a timout or anything happening, the browser just keeps on waiting for the response.

When I visit: myapp.com:3000/non-existing-route I get this neverending loading
However, when I visit localhost:3000/non-existing-route everything seems to work fine ( I get a 404 error )

PPS. I am also using cluster, if that makes any difference.

@ragulka

Some additional information: the way I have it currently set up is that I use express.vhost in my last initializer, where I also use app.router. Like this:

module.exports = function() {
  global app = this;
  app.use(app.router);
  // Listen to vhost
  app.use(express.vhost('*.example.com', app.express))
  app.use(express.vhost('example.com', app.express));
}

I also tried using app instead of app.express, in which case I do not get an endless loop, but a TypeError: Object #<Locomotive> has no method 'emit' - which happens in connect.vhost middleware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment