title: express.js - How do I serve different static folders on production and development separately?
body: <p>So basically I want to serve the <code>../client</code> directory on development, where it has the current files being edited. During production, however, I have a folder <code>../client/dist</code> that I want to serve. How do I achieve this?</p>
  
  <p>I tried making a simple <code>if</code> condition but for some reason it does not seem to work and it doesn't load the files.</p>
  
  <pre><code>const production = process.env.NODE_ENV === 'production'
  if (production) {
      app.use(express.static(__dirname + '../client/dist'))
  } else {
      app.use(express.static(__dirname + '../client'))
  }
  </code></pre>
  
  <p>Any help will be appreciated. Thanks.</p>