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

shortest route (without static prefix-path) not working #69

Closed
benbonnet opened this issue Jun 8, 2016 · 3 comments
Closed

shortest route (without static prefix-path) not working #69

benbonnet opened this issue Jun 8, 2016 · 3 comments

Comments

@benbonnet
Copy link

benbonnet commented Jun 8, 2016

The posts route here (https://github.com/jaredpalmer/react-production-starter/blob/master/src/routes/Post/index.js#L6) show posts/:slug, slug being dynamic

I was looking into having a short one, like "http://domain.stuff/my-post-slug", which would translate to path: ':slug' at the same spot. Thing is, no way to make it work that short

Using the same with regular routing (not ssr and no dynamic redux routes loading), it works without problem. But I just can't see how to solve this in those fields — sorry if the answer is obvious; but thx a lot if it exists !

(ps thx a lot for the patterns and arch exposed in this repo! best work found)

@benbonnet benbonnet reopened this Jun 8, 2016
@jaredpalmer
Copy link
Owner

jaredpalmer commented Jun 8, 2016

Just tried this out. You'll have to basically handle not found errors in your PostPage because :slug path will end up intercepting all requests to *.

thanks for the complement!

@jaredpalmer
Copy link
Owner

Don't forget to change the <Link /> in <PostListItem />.

@benbonnet
Copy link
Author

benbonnet commented Jun 8, 2016

sorry i closed and reopened but… it does work pretty okay on your repo (changing path and url in the list component). i tweaked this repo a bit, the problem happened serverside when requiring images in some components (src was a js object on the server, instead of being inlined as source uri). guess i have to check a bit more what's to be done in web pack (image loader or so)

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