mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-17 21:41:49 +03:00
b0af496c98
no issue - anonymous functions are hard to debug in memory traces etc - having anonymous middleware functions makes it hard to inspect or debug the middleware stack (something I like to do) - these 2 are the only ones atm, including all 3rd party middleware
14 lines
332 B
JavaScript
14 lines
332 B
JavaScript
var config = require('../config'),
|
|
i18n = require('../i18n'),
|
|
errors = require('../errors');
|
|
|
|
module.exports = function maintenance(req, res, next) {
|
|
if (config.get('maintenance').enabled) {
|
|
return next(new errors.Maintenance(
|
|
i18n.t('errors.general.maintenance')
|
|
));
|
|
}
|
|
|
|
next();
|
|
};
|