chore: Eager load integration apps

This commit is contained in:
Faruk AYDIN
2021-10-26 22:25:59 +02:00
committed by Ali BARIN
parent cbfba465db
commit 561f539123
2 changed files with 11 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import morgan from './helpers/morgan';
import appAssetsHandler from './helpers/app-assets-handler';
import errorHandler from './helpers/error-handler';
import './config/database';
import './helpers/eager-load-apps';
import authentication from './helpers/authentication';
const app = express();

View 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}`);
})
}