Ghost/core/server/middleware/maintenance.js

14 lines
332 B
JavaScript
Raw Normal View History

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();
};