At the moment I have the following which sits below all my other routes:
app.get(\'*\', function(req, res){ console.log(\'404ing\'); res.render(\'404\');
I wanted a catch all that would render my 404 page only on missing routes and found it here in the error handling docs https://expressjs.com/en/guide/error-handling.html
app.use(function (err, req, res, next) { console.error(err.stack) res.status(404).render('404.ejs') })
This worked for me.