2017-06-17 22:51:30 +02:00
|
|
|
module.exports = app => {
|
|
|
|
// route for the home page
|
2017-09-07 21:36:03 +02:00
|
|
|
app.get('/', (req, res) => {
|
|
|
|
res.status(200).render('index');
|
2017-06-19 18:37:35 +02:00
|
|
|
});
|
2017-06-17 22:51:30 +02:00
|
|
|
// a catch-all route if someone visits a page that does not exist
|
2017-09-07 21:36:03 +02:00
|
|
|
app.use('*', ({ originalUrl, ip }, res) => {
|
2017-06-30 02:10:14 +02:00
|
|
|
// send response
|
2018-02-01 06:08:28 +01:00
|
|
|
res.status(404).render('404');
|
2017-06-19 18:37:35 +02:00
|
|
|
});
|
|
|
|
};
|