spee.ch/routes/home-routes.js

14 lines
386 B
JavaScript
Raw Normal View History

const logger = require('winston');
module.exports = app => {
// route for the home page
app.get('/', (req, res) => {
res.status(200).render('index');
});
// a catch-all route if someone visits a page that does not exist
app.use('*', (req, res) => {
2017-06-21 01:36:19 +02:00
logger.error(`Get request on ${req.originalUrl} which was a 404`);
res.status(404).render('fourOhFour');
});
};