senecajs / seneca

A microservices toolkit for Node.js.
http://senecajs.org
MIT License
3.96k stars 312 forks source link

Issue with pattern matching #599

Open Shobhit28 opened 7 years ago

Shobhit28 commented 7 years ago

I have 2 urls like :

  1. /test/run
  2. /test/{test_id}

I have 2 separate routes for them like:

  1. { prefix: '/test', pin: 'role:test,cmd:*', map:{ run: {GET: true} } }

  2. { pin: 'role:test,cmd:*', map:{ test: {GET: true, suffix: '/:test_id'} } }

However when I access /test/run. The second pattern gets triggered with run as a URL parameter.

Is this the expected behaviour or is there some other way to do this ?

rjrodger commented 7 years ago

@Shobhit28 This should probably go in https://github.com/senecajs/seneca-web /cc @tswaters