mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Revert "Moved labs middleware into labs utility"
This reverts commit 161ba51d2b
.
This commit is contained in:
parent
161ba51d2b
commit
145762485e
12
core/server/web/shared/middlewares/labs.js
Normal file
12
core/server/web/shared/middlewares/labs.js
Normal file
@ -0,0 +1,12 @@
|
||||
const errors = require('@tryghost/errors');
|
||||
const labsUtil = require('../../../../shared/labs');
|
||||
|
||||
const labs = flag => (req, res, next) => {
|
||||
if (labsUtil.isSet(flag) === true) {
|
||||
return next();
|
||||
} else {
|
||||
return next(new errors.NotFoundError());
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = labs;
|
@ -94,11 +94,3 @@ module.exports.enabledHelper = function enabledHelper(options, callback) {
|
||||
|
||||
return errString;
|
||||
};
|
||||
|
||||
module.exports.enabledMiddleware = flag => (req, res, next) => {
|
||||
if (this.isSet(flag) === true) {
|
||||
return next();
|
||||
} else {
|
||||
return next(new errors.NotFoundError());
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user