removed similar code

v1.18.x
barisusakli 11 years ago
parent e5a5b8e8bf
commit a3842d2c61

@ -2,28 +2,24 @@
var staticController = {};
staticController['404'] = function(req, res, next) {
if (!res.locals.isAPI) {
res.statusCode = 404;
}
res.render('404', {});
staticController['404'] = function(req, res) {
renderStatic(404, req, res);
};
staticController['403'] = function(req, res, next) {
if (!res.locals.isAPI) {
res.statusCode = 403;
}
staticController['403'] = function(req, res) {
renderStatic(403, req, res);
};
res.render('403', {});
staticController['500'] = function(req, res) {
renderStatic(500, req, res);
};
staticController['500'] = function(req, res, next) {
function renderStatic(statusCode, req, res) {
if (!res.locals.isAPI) {
res.statusCode = 500;
res.statusCode = statusCode;
}
res.render('500', {});
};
res.render(statusCode.toString(), {});
}
module.exports = staticController;
Loading…
Cancel
Save