title: How can I configure express to serve a single home page for many different paths?
body: <p>This is what I have in mind:</p>
  <pre><code>app.use(express.static(path.join(__dirname, 'public')));
  
  app.get('/foo', (req, res) =&gt; {
    // server the public folder again here
  });
  
  app.get('/bar/:id', (req, res) =&gt; {
    // server the public folder again here
  });
  </code></pre>
  <p>I'm trying to deploy a react app that uses routing. The problem is, I need to point all user-facing paths (so, /about, /contact, etc. but not /assets/images/icon.png) back to the homepage, because the react app uses react-router, and once the app is built for production and served as a static site, going to mysite.com/about gives a 404, where it wouldn't have before building.</p>