Ghost/core/server/web/shared/middlewares/labs.js
2021-07-08 07:09:06 +01:00

13 lines
300 B
JavaScript

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;