question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specifying a basename when app isn't hosted at site root

See original GitHub issue

I’m trying to use redux-first-router in a create-react-app app that specifies a homepage in package.json since the app won’t be hosted at the root of the site. From what I can tell, it looks like I’ll have to include that route prefix for each entry in my routesMap. I’ve been looking through the RFR source to see if there’s a way to pass a basename (or similar) option that would allow the pathname to be enhanced if that option exists but it doesn’t look like it’s possible at the moment.

Is there currently a way to use RFR when an app isn’t going to run at the root of a site? If not, is it reasonable to request the ability to specify a basename - perhaps in the options passed to connectRoutes?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

0reactions
faceyspaceycommented, Aug 28, 2017

We don’t. That’s not what Im saying. I’m saying there’s likely more that also needs to be done and we should find it, or this would be closed.

Just take it over brotha and take it all the way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How should I configure create-react-app to serve app from ...
By default, Create React App produces a build assuming your app is hosted at the server root. To override this, specify the homepage...
Read more >
Runtime environment variables - facebook/create-react-app
I've been struggling with this problem in few projects and IMHO it's crucial to be able to specify environment variables for configuring the ......
Read more >
Deploying Your CRA React App on Github Pages
1. Check out the Github Pages settings. Open up your Github repo and navigate to Settings > Pages. This is going to be...
Read more >
Configuration | UmiJS
Specify the base of the react-router to be configured when deploying to a non-root directory. # publicPath. Type: String; Default: /. Specifies the...
Read more >
Shared Options
Project root directory (where index.html is located). Can be an absolute path, or a path relative to the current working directory. See Project...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found