strapi/packages/core/admin/strapi-server.js

19 lines
475 B
JavaScript
Raw Normal View History

2021-08-02 17:54:49 +02:00
'use strict';
const _ = require('lodash');
const admin = require('./dist/server');
2021-08-02 17:54:49 +02:00
const mergeRoutes = (a, b, key) => {
return _.isArray(a) && _.isArray(b) && key === 'routes' ? a.concat(b) : undefined;
};
2022-12-11 02:56:14 +01:00
if (strapi.EE) {
const eeAdmin = require('./dist/ee/server');
// module.exports = admin;
// TODO: change to avoid issue with lodash merging frozen objects
2021-08-02 17:54:49 +02:00
module.exports = _.mergeWith({}, admin, eeAdmin, mergeRoutes);
} else {
module.exports = admin;
}