title: NodeJS/Express proper handle of React builds
body: <p>I would like to know how to properly handle React builds in a Express app. One major issue that I'm having right now is that, when using a browser the React app is always prioritized over other endpoints, even though it is at the end of the express chain.</p>
  
  <p>I add the React build as static folder like so:</p>
  
  <pre><code>app.use(express.static(path.join(__dirname, '/react'), {
    etag: false
  }));
  </code></pre>
  
  <p>Also tried to set <code>etag</code> to <code>false</code> so it wouldn't cache the app, but it still opens even when the server is down. I send the react build by using a wildcard <code>GET</code> request at the end of the express chain:</p>
  
  <pre><code>app.get('*', (req, res) =&gt; {
    res.sendFile(path.join(global.appRoot, '/views/index.html'));
  });
  </code></pre>
  
  <p>There are other endpoints before it, but non of them are accessed through the browser, it just skips to the React build. The endpoints are called fine if Postman is used.</p>