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

Support .* for routes #24

Closed
raadad opened this Issue Apr 16, 2015 · 7 comments

Comments

Projects
None yet
4 participants
@raadad

raadad commented Apr 16, 2015

Currently /path/:restofroute(.*) - does not match /path/abc/def/ghi/jkl/mnop
Is this not supported, or is there an alternate way of doing this?

@daliwali

This comment has been minimized.

Show comment
Hide comment
@daliwali

daliwali Apr 17, 2015

👍 to this, just tried it and it doesn't seem work.

👍 to this, just tried it and it doesn't seem work.

@raadad

This comment has been minimized.

Show comment
Hide comment
@raadad

raadad Apr 18, 2015

path-to-regexp seems to support this /:foo*
however this comes up as an error with the trie router.

raadad commented Apr 18, 2015

path-to-regexp seems to support this /:foo*
however this comes up as an error with the trie router.

@daliwali

This comment has been minimized.

Show comment
Hide comment
@daliwali

daliwali Apr 20, 2015

My workaround for this is extremely ugly:

[
  '/(.*)',
  '/(.*)/(.*)',
  '/(.*)/(.*)/(.*)',
  '/(.*)/(.*)/(.*)/(.*)',
  '/(.*)/(.*)/(.*)/(.*)/(.*)'
]

@jonathanong pls :(

My workaround for this is extremely ugly:

[
  '/(.*)',
  '/(.*)/(.*)',
  '/(.*)/(.*)/(.*)',
  '/(.*)/(.*)/(.*)/(.*)',
  '/(.*)/(.*)/(.*)/(.*)/(.*)'
]

@jonathanong pls :(

@jonathanong

This comment has been minimized.

Show comment
Hide comment
@jonathanong

jonathanong Apr 20, 2015

Member

globs are an antipattern. :) this was intentional. i do actually use both routington and path-to-regexp depending on what i need though

Member

jonathanong commented Apr 20, 2015

globs are an antipattern. :) this was intentional. i do actually use both routington and path-to-regexp depending on what i need though

@jonathanong

This comment has been minimized.

Show comment
Hide comment
@yoshuawuyts

This comment has been minimized.

Show comment
Hide comment
@yoshuawuyts

yoshuawuyts Apr 22, 2015

Contributor

@jonathanong neat writeup, thanks for sharing your thoughts ^^

Contributor

yoshuawuyts commented Apr 22, 2015

@jonathanong neat writeup, thanks for sharing your thoughts ^^

@daliwali

This comment has been minimized.

Show comment
Hide comment
@daliwali

daliwali Apr 23, 2015

The use case I have is serving a proxy endpoint, so that any request to /proxy/:endpoint* would be matched, and also serving an index.html for arbitrary routes generated from a web browser using History API, which is opaque to the server. Thanks for the blog post though.

The use case I have is serving a proxy endpoint, so that any request to /proxy/:endpoint* would be matched, and also serving an index.html for arbitrary routes generated from a web browser using History API, which is opaque to the server. Thanks for the blog post though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment