mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-17 05:21:36 +03:00
6f6c8f4521
refs #9178 - avoid importing 4 modules (logging, errors, events and i18n) - simply require common in each file
13 lines
339 B
JavaScript
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();
|
|
};
|