2016-07-25 22:28:35 +03:00
|
|
|
var config = require('../config'),
|
|
|
|
i18n = require('../i18n'),
|
|
|
|
errors = require('../errors');
|
2016-07-15 19:22:41 +03:00
|
|
|
|
2016-09-26 12:10:44 +03:00
|
|
|
module.exports = function maintenance(req, res, next) {
|
2016-09-13 18:41:14 +03:00
|
|
|
if (config.get('maintenance').enabled) {
|
2016-10-06 15:27:35 +03:00
|
|
|
return next(new errors.MaintenanceError({message: i18n.t('errors.general.maintenance')}));
|
2016-07-15 19:22:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
next();
|
|
|
|
};
|