node-restify
node-restify copied to clipboard
Route not found
Hi,
I'm using the restify 8.4.0 version, Suddenly I encounter an issue regarding routes.
I have these routes.
/user/update /user/home /:node/graph
when I requested /user/update or /user/home its working properly but when I requested /user/graph the server can't found this route.
the server should found this route since /:node/graph -- whatever we supply on "node" param its should be working.
This sample routes its working on 4.3.4 version.
Thanks
Read this: https://github.com/delvedor/find-my-way#match-order
Hope it clarifies. I too faced this issue but post reading this, things got the required clarity.
It seems an issue to me, based on the documentation they are reading the routes per chunk. If I'm correct.
Btw, these kind of routing its working fine on 4.3.4 version.
the issue on POST method
I have 2 routes
server.post('/:node/sample', doSample) server.post('/:node', doEverything)
i tried to request /user/sample it will route to /:node instead of /:node/sample
Hi @AaronTrazona , I stumbled across this bug, and may have more info. My guess and opinion after investigating this for the past 10 minutes, is that findmyway is just broken and misleading:
https://github.com/delvedor/find-my-way/issues/149 https://github.com/delvedor/find-my-way/issues/161
Essentially the way it works is it builds a tree of all routes, and then goes down that route based on matches so in your example it would have:
- user
- update
- home
- :node/graph
The URL requested matches user so it goes into that branch, then it can't find anything for graph and so it's a not found.