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

is a "catchAll" route impossible by design? #22

Closed
ingoradatz opened this issue Sep 26, 2014 · 1 comment
Closed

is a "catchAll" route impossible by design? #22

ingoradatz opened this issue Sep 26, 2014 · 1 comment

Comments

@ingoradatz
Copy link

The catchAll route "(*path)": "catchAll" used in the ampersand demo webapp must be the last route in the hash. Otherwise every route defined after is impossible to reach.

{
  "index.html": "home",
  "collections": "collectionDemo",
  "info": "info",
  "person/add": "personAdd",
  "person/:id": "personView",
  "person/:id/edit": "personEdit",
  "(*path)": "catchAll"
}

The Problem is that the object key sorting is not static. I have handled the routes as JSON before using it to extend the router and they got sorted alphabetically. In result the catchAll-Route enters the first place.

{
  "(*path)": "catchAll",
  "collections": "collectionDemo",
  "index.html": "home",
  "info": "info",
  "person/:id": "personView",
  "person/:id/edit": "personEdit",
  "person/add": "personAdd"
}

Should we switch to an array of routes or oversee i something that solves the problem an other way?

@bear bear added the question label Oct 30, 2014
@kamilogorek
Copy link
Contributor

@llabball that's correct that order matters here and if you'll resort your routes, they simply won't work. Please let me know if you'd like to discuss this issue in depth, so I'll reopen this ticket then.

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