Ghost/core/server/middleware/maintenance.js

12 lines
326 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.MaintenanceError({message: i18n.t('errors.general.maintenance')}));
}
next();
};