You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
539 B
JavaScript

11 years ago
"use strict";
11 years ago
var staticController = {},
isApi = function(path) {
return !!path.match('api');
};
staticController['404'] = function(req, res, next) {
11 years ago
if (!isApi(req.path)) {
res.statusCode = 404;
}
res.render('404', {});
};
staticController['403'] = function(req, res, next) {
11 years ago
if (!isApi(req.path)) {
res.statusCode = 403;
}
res.render('403', {});
};
staticController['500'] = function(req, res, next) {
11 years ago
if (!isApi(req.path)) {
res.statusCode = 500;
}
res.render('500', {});
};
module.exports = staticController;