mscdex / express-optimized

A minimal, optimized version of Express
MIT License
13 stars 1 forks source link

.VERB seems to not route correctly #6

Closed dougwilson closed 10 years ago

dougwilson commented 10 years ago

The following will never hit the /test route, no matter what. Instead it is routing to the / route for some reason. Is this intended?

router.get('/', function (req, res) {
  res.end('hi!\n')
})
router.get('/test', function (req, res) {
  res.end('testing 123!\n')
})
curl http://localhost:3000/test
hi!
dougwilson commented 10 years ago

Nevermind, I see it says

Same as use() except specific to the particular HTTP verb.

Which means that it just matches on the prefix only in this router, not on the whole path. Sorry!