mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Moved labs middleware into labs utility
- this middleware isn't used anywhere at the moment - including it in our labs utility should help to make it moe discoverable
This commit is contained in:
parent
782de52678
commit
161ba51d2b
2 changed files with 8 additions and 12 deletions
|
@ -1,12 +0,0 @@
|
||||||
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,3 +94,11 @@ module.exports.enabledHelper = function enabledHelper(options, callback) {
|
||||||
|
|
||||||
return errString;
|
return errString;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.enabledMiddleware = flag => (req, res, next) => {
|
||||||
|
if (this.isSet(flag) === true) {
|
||||||
|
return next();
|
||||||
|
} else {
|
||||||
|
return next(new errors.NotFoundError());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue