We have a rapidly growing React application which renders on both the server- and client-sides. Some sections of the app are on separate subdomains. The same app uses the same assets across many subdomains, so we control it all through the one runtime. This mean react-router needs to be able to distinguish which host or subdomain it's on.
Proposal
HostRoutewhich subclassesRouteand is aware of the host via a static methodHostRoute.setHost(url.parse(res.url).hostname)- Static method called before Router.run() (on init of app) i.e.
HostRoute.setHost(url.parse(req.url).hostname)and/orHostRoute.setHost(window.location.hostname) - Makes sense, since host will never change during the lifetime of the application, a significantly lighter approach and "opt-in" for those who require it.
- Will require addition to
modules/Matchto ask the Route itself if it might be a match (if host matc