| 
									
										
										
										
											2021-08-02 17:54:49 +02:00
										 |  |  | 'use strict'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const _ = require('lodash'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-16 16:38:15 +01:00
										 |  |  | 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) { | 
					
						
							| 
									
										
										
										
											2023-11-16 16:38:15 +01:00
										 |  |  |   const eeAdmin = require('./dist/ee/server'); | 
					
						
							|  |  |  |   // module.exports = admin;
 | 
					
						
							| 
									
										
										
										
											2024-04-22 14:56:57 +02:00
										 |  |  |   // 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; | 
					
						
							|  |  |  | } |