title: Can I set a base route in react-router
body: <p>Assuming my app's base url is <em>example.com/app</em></p>
  
  <p>Is it possible to set a base route in react-router so instead of writing all routes as</p>
  
  <pre><code>/app/a
  /app/b
  /app/c
  </code></pre>
  
  <p>I can just specify them as </p>
  
  <pre><code>a
  b
  c
  </code></pre>
  
  <p>I tried the below example I found in the <a href="https://github.com/reactjs/react-router/blob/master/docs/guides/Histories.md" rel="noreferrer">docs</a> but it wouldn't work (page would display nothing). Maybe it's because I'm using react-router@3.0.0-alpha.1, or I'm doing something wrong. </p>
  
  <pre><code>import { useRouterHistory } from 'react-router'
  import { createHistory } from 'history'
  
  const history = useRouterHistory(createHistory)({
    basename: '/app'
  })
  
  const Root = ({store}) =&gt; (
      &lt;Provider store={store}&gt;
          &lt;Router history={history}&gt;
              &lt;Route path='/' component={App}&gt;
                  ...
              &lt;/Route&gt;
          &lt;/Router&gt;
      &lt;/Provider&gt;
  )
  </code></pre>