Files
NodeBB/src/controllers/static.js

24 lines
410 B
JavaScript
Raw Normal View History

2014-03-02 23:07:16 -05:00
"use strict";
2014-03-26 11:43:42 -04:00
var staticController = {};
2014-03-27 12:59:27 -04:00
createStatic('404');
createStatic('403');
createStatic('500');
2014-03-27 12:59:27 -04:00
function createStatic(statusCode) {
staticController[statusCode] = function(req, res) {
if (!res.locals.isAPI) {
res.statusCode = parseInt(statusCode, 10);
}
2014-03-26 11:39:27 -04:00
res.render(statusCode, {
errorMessage: req.flash('errorMessage')[0] || undefined
});
2014-03-27 12:59:27 -04:00
};
}
2014-03-27 12:59:27 -04:00
module.exports = staticController;
2014-03-26 11:39:27 -04:00