Do you really mean to use router.route('/search:word')
instead of router.route('/search/:word')
? Using colon there seems kind of odd.
If you use router.route('/search/:word')
, and if your request is
/places/search/test
then you get req.params.word="test"