mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
- This isn't really a "service" - it's a set of utilities for working with labs flags - It's also required all over the place, and doesn't require anything that isn't shared - Therefore, it should live in shared
12 lines
300 B
JavaScript
12 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;
|