title: Express js, how to match all routes, even sub routes
body: <p>I am building a node js app that needs to return a 404 page for all routes except for the <code>/video</code> route.</p>
  
  <pre><code>app.get('/video/*', Video.show)
  app.get('*', (req,res) =&gt; res.render('not_found'))
  </code></pre>
  
  <p>This works if the URL does not have subdirectories. 
  The problem arises when someone enters a URL with subdirectories such as <code>/hello/subhello/</code>. This is not caught by my routes.</p>
  
  <p>I already tried these options with no success:</p>
  
  <pre><code>app.get('/*', (req,res) =&gt; res.render('not_found'))
  app.use((req,res) =&gt; res.render('not_found'))
  </code></pre>
  
  <p>Am I missing something ?</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>When i remove the code to set up handlebars the routes are followed as expected.</p>
  
  <p>This is the handlebars set up code:</p>
  
  <pre><code>app.engine('.hbs', exphbs({
      extname:'.hbs',
      defaultLayout:'layout.hbs',
      layoutsDir: __dirname+ '/views'
    }))
    app.set('view engine', '.hbs')
    app.set('views', __dirname + '/views')
  </code></pre>