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

Problem with path delimiter and values #841

Closed
Hyra opened this issue Feb 15, 2015 · 3 comments
Closed

Problem with path delimiter and values #841

Hyra opened this issue Feb 15, 2015 · 3 comments
Labels

Comments

@Hyra
Copy link

Hyra commented Feb 15, 2015

I want to have URLs looking like:

/someone/12345-projectslug

I use the following route for it:

<Route name='project' path='/:owner/:projectId-:projectSlug' handler={Project} />

This works well, unless there's a dash - inside the projectSlug

One solution would be to have a double dash as a delimiter, but this doesn't look as nice, and maybe there's a better solution.

Any help is appreciated!

@mjackson
Copy link
Member

We should probably make the regex greedy so that when it's trying to match projectSlug it matches all the way to the next char that doesn't make sense.

@taion
Copy link
Contributor

taion commented Nov 7, 2015

This sort of thing would be much better handled with #2286.

@alexesDev
Copy link

alexesDev commented Oct 21, 2016

I know this is an old issue, but I had a similar problem and... just change route like this:

<Route name='project' path='/:owner/:projectSlug-:projectId' handler={Project} />

@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants