title: express.static handling root url request
body: <p>express.static is handling the root url request.
  e.g. I want to do a redirect in express from <a href="https://example.com" rel="noreferrer">https://example.com</a> to <a href="https://example.com/dashboard" rel="noreferrer">https://example.com/dashboard</a>.
  Check the cases below, first one works, second does not. I expect the second to work too. Anyone knows why?</p>
  
  <p>Case 1 (works)</p>
  
  <pre><code>app.get('/', (req, res, next) =&gt; {
     res.redirect('/dashboard');
  })    
  
  app.use(express.static(path.join(__dirname, 'dist')))
  
  app.get('/dashboard', (req, res, next) =&gt; {
     //do stuff
  }) 
  </code></pre>
  
  <p>Case 2 (does not work for me)</p>
  
  <pre><code>app.use(express.static(path.join(__dirname, 'dist')))
  
  //request doesn't come here 
  app.get('/', (req, res, next) =&gt; {   
     res.redirect('/dashboard')
  })
  
  app.get('/dashboard', (req, res, next) =&gt; {
    //do some stuff
  }) 
  </code></pre>