mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
chore: move enableFeatureMiddleware to utils
This commit is contained in:
parent
52b2aed092
commit
66a2bba78e
15
packages/core/admin/ee/server/routes/utils.js
Normal file
15
packages/core/admin/ee/server/routes/utils.js
Normal file
@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
const { features } = require('@strapi/strapi/lib/utils/ee');
|
||||
|
||||
const enableFeatureMiddleware = (featureName) => (ctx, next) => {
|
||||
if (features.isEnabled(featureName)) {
|
||||
return next();
|
||||
}
|
||||
|
||||
ctx.status = 404;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
enableFeatureMiddleware,
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user