const Config = require('./config');
const log = require('../logger').config;

if (!process.env.EG_CONFIG_DIR) {
  process.env.EG_CONFIG_DIR = __dirname;
}

const config = new Config();

try {
  config.loadSystemConfig();
  config.loadGatewayConfig();
  config.loadModels();
} catch (err) {
  log.error(err);
  process.exit(1);
}

module.exports = config;

@@ -185,16 +185,39 @@
 %0A%0Atry %7B%0A
+  config.loadModels();%0A
   config
@@ -267,39 +267,16 @@
 nfig();%0A
-  config.loadModels();%0A
 %7D catch 

Load models first