title: Serve static bundle.js from remote file via Express as your static file server
body: <p>I am trying to serve a <em>React front-end</em> (bundle.js) with an <em>Express back-end.</em></p>
  
  <p>The repositories exist independently of one another. The static React bundle file is hosted remotely on a separate file server (nginx). </p>
  
  <p>I want Express to be both the file server that serves the static file, as well as the application server responsible for the api endpoints. </p>
  
  <p>I know about <code>express.static()</code> method, however, that would only work if the bundle file is in the same directory as the back-end. But in my case the repos are separate. How can I achieve this?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>So the only solution to this is to have the <em>build</em> folder included in the deployed Express-backend. I simply had Webpack spit out the <em>bundle.js</em> to the back-end repo, and am  not using <code>express.static()</code> method to successfully serve it.</p>