title: × React - fetch('/') won't hit index route in Express.router
body: <p>I've worked a bit with Express but am new-ish to React. I have React already hooked up to an Express server that works but having a problem getting <code>fetch('/')</code> in my main React App component to hit the index route in my Express app. For example I have these route in Express:</p>
  
  <pre><code>app.use('/', routes);
  app.use('/users', users);
  </code></pre>
  
  <p>Both routes are identical in Express. They make a simple call to MongoDB and the response is <code>res.json(data)</code>. Also when I test these routes pure on the Express port they both work fine.</p>
  
  <p>Below is my React component. The problem is when I try to use <code>fetch('/')</code> to hit the corresponding <code>app.use('/', routes);</code> in Express it doesn't work. If I change it to <code>fetch('/users')</code> it works. </p>
  
  <pre><code>import React, { Component } from 'react';
  import './App.css';
  
  class App extends Component {
    state = {users: []}
  
    componentDidMount() {
      fetch('/') // this route doesn't work with Express!
        .then(res =&gt; res.json())
        .then(users =&gt; this.setState({ users }));
    }
  
    render() {
      return (
        &lt;div className="App"&gt;
          &lt;h1&gt;Users&lt;/h1&gt;
          {this.state.users.map(user =&gt;
            &lt;div key={user.id}&gt;{user.username}&lt;/div&gt;
          )}
        &lt;/div&gt;
      );
    }
  }
  
  export default App;
  </code></pre>
  
  <p>Of course I could change the index route name to <code>('/index')</code> or something but I'd like to keep it as <code>('/')</code> route in the Express app if at all possible.</p>
  
  <p>If anyone can point out what I am doing wrong or things I can try I'd be grateful. Thanks in advance!</p>