Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route not found #1811

Open
AaronTrazona opened this issue Dec 11, 2019 · 4 comments
Open

Route not found #1811

AaronTrazona opened this issue Dec 11, 2019 · 4 comments

Comments

@AaronTrazona
Copy link

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

@manisuec
Copy link

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.

@AaronTrazona
Copy link
Author

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.

@AaronTrazona
Copy link
Author

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

@SJrX
Copy link

SJrX commented Apr 27, 2021

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:

delvedor/find-my-way#149
delvedor/find-my-way#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants