mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-17 13:31:39 +03:00
d08926c347
refs #6976, #7019, #7125 - Ensure maintenance mode flag is set back to what is in config.js rather than defaulted to false on boot - Remove stack trace from 503 errors - Add error message to 503 error - Ensure error page is rendered for Ghost-Admin on reload with 503
14 lines
314 B
JavaScript
14 lines
314 B
JavaScript
var config = require('../config'),
|
|
i18n = require('../i18n'),
|
|
errors = require('../errors');
|
|
|
|
module.exports = function (req, res, next) {
|
|
if (config.maintenance.enabled) {
|
|
return next(new errors.Maintenance(
|
|
i18n.t('errors.general.maintenance')
|
|
));
|
|
}
|
|
|
|
next();
|
|
};
|