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

Unmatch path state? #7

Open
royhg opened this issue Mar 1, 2017 · 2 comments
Open

Unmatch path state? #7

royhg opened this issue Mar 1, 2017 · 2 comments

Comments

@royhg
Copy link

royhg commented Mar 1, 2017

Dear Gary,

How to add routes with unmatch path state?
So I can redirect to 404 page?

Tq.
Roy

@garygreen
Copy link
Owner

garygreen commented Mar 1, 2017

Routes are matched in order, so first matching one is executed first and then stops. Therefore you can add a route at the very end which always matches, like...

router.add('.*', my404Handler);

@garygreen
Copy link
Owner

.run() also returns a route that was matched, so you could use that to determine how to proceed in your app.

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

2 participants