chore: Eager load integration apps
This commit is contained in:
@@ -9,6 +9,7 @@ import morgan from './helpers/morgan';
|
|||||||
import appAssetsHandler from './helpers/app-assets-handler';
|
import appAssetsHandler from './helpers/app-assets-handler';
|
||||||
import errorHandler from './helpers/error-handler';
|
import errorHandler from './helpers/error-handler';
|
||||||
import './config/database';
|
import './config/database';
|
||||||
|
import './helpers/eager-load-apps';
|
||||||
import authentication from './helpers/authentication';
|
import authentication from './helpers/authentication';
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
10
packages/backend/src/helpers/eager-load-apps.ts
Normal file
10
packages/backend/src/helpers/eager-load-apps.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import App from '../models/app';
|
||||||
|
import appConfig from '../config/app';
|
||||||
|
|
||||||
|
if(appConfig.appEnv === 'development') {
|
||||||
|
const apps = App.findAll();
|
||||||
|
|
||||||
|
apps.forEach((app: any) => {
|
||||||
|
import(`../apps/${app.key}`);
|
||||||
|
})
|
||||||
|
}
|
Reference in New Issue
Block a user