Ghost/core/server/web/middleware/maintenance.js
kirrg001 6f6c8f4521 Import lib/common only
refs #9178

- avoid importing 4 modules (logging, errors, events and i18n)
- simply require common in each file
2017-12-12 10:28:13 +01:00

13 lines
339 B
JavaScript

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