on-internet
← Community

Configuring app's basename in react-router

Stack Overflow ·

I'm struggling a bit with react-router 2.x configuration, specifically app basename. I've an application which may have different base root throughout its lifecycle. For instance: / in development /users in production /account in production after migration The basename comes into play in several places: static asset compilation in Webpack react-router main configuration specifying redirect routes in redux actions providing something like redirectUrl to API calls My current solution is to have an ENV variable and make it available both to Webpack and to the app itself by injecting window.defs v

Comments

Sign in or sign up to comment and upvote.

No comments yet.