initial commit.

This commit is contained in:
mntmn
2017-04-07 01:29:05 +02:00
commit 7ff2926578
258 changed files with 83743 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
'use strict';
module.exports = (req, res, next) => {
res.bad_request = (msg) => {
if (req.accepts('text/html')) {
res.status(400).render('error', {
message: msg
});
} else {
res.status(400).json({
"error": msg
});
}
}
next();
}