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