2017-04-07 01:29:05 +02:00
|
|
|
'use strict';
|
|
|
|
|
2018-04-12 18:40:58 +02:00
|
|
|
require('../models/db');
|
2017-04-07 01:29:05 +02:00
|
|
|
var config = require('config');
|
|
|
|
|
|
|
|
module.exports = (req, res, next) => {
|
|
|
|
var err = new Error('Not Found');
|
|
|
|
if (req.accepts('text/html')) {
|
|
|
|
res.status(404).render('not_found', {
|
|
|
|
title: 'Page Not Found.'
|
|
|
|
});
|
|
|
|
} else if (req.accepts('application/json')) {
|
|
|
|
res.status(404).json({
|
|
|
|
"error": "not_found"
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
res.status(404).send("Not Found.");
|
|
|
|
}
|
2018-04-12 18:40:58 +02:00
|
|
|
}
|