Ghost/core/server/middleware/maintenance.js

14 lines
321 B
JavaScript
Raw Normal View History

var config = require('../config'),
i18n = require('../i18n'),
errors = require('../errors');
module.exports = function (req, res, next) {
if (config.get('maintenance').enabled) {
return next(new errors.Maintenance(
i18n.t('errors.general.maintenance')
));
}
next();
};