Ghost/core/server/web/shared/middlewares/labs.js

13 lines
300 B
JavaScript
Raw Normal View History

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;