visionmedia/express — Issue #979: Error in req.query
Author: dalcib
Created: 2012-01-26 12:59:00+00:00
State: open

I have these routes:

app.get('/:collection', function (req, res) { res.send(req.query)})
app.get('/:collection/:id', function (req, res) { res.send(req.query)})

If I call http://localhost/myCollection/myId?limit=2 is returned { limit : '2' }
If I call http://localhost/myCollection/?limit=2 is returned { limit : '2' }

However

If I call http://localhost/myCollection?limit=2 is returned { }
The query ?limit=2 is not recognised.

Is this a Express bug?
How can I do this work correctly.

I am using Express 2.5.6 and Node 0.6.5.

Thanks.