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.
HostRoute which subclasses Route and is aware of the host via a static method HostRoute.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/or HostRoute.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/Match to ask the Route itself if it might be a match (if host matc