diff --git a/packages/api/src/index.js b/packages/api/src/index.js index be318b74..8f740c07 100644 --- a/packages/api/src/index.js +++ b/packages/api/src/index.js @@ -1,5 +1,4 @@ const shell = require('./shell'); -const main = require('./main'); const argument = process.argv[2]; if (argument && argument.endsWith('Process')) { @@ -8,11 +7,12 @@ if (argument && argument.endsWith('Process')) { const module = proc[argument]; module.start(); } else if (!module['parent'] && !process.argv.includes('--checkParent')) { + const main = require('./main'); main.start(argument); } module.exports = { ...shell, - mainModule: main, + getMainModule: () => require('./main'), }; diff --git a/packages/dbgate/bin/dbgate.js b/packages/dbgate/bin/dbgate.js old mode 100644 new mode 100755 index 3e9a13a2..be7f1240 --- a/packages/dbgate/bin/dbgate.js +++ b/packages/dbgate/bin/dbgate.js @@ -2,4 +2,4 @@ const dbgateApi = require('dbgate-api'); -dbgateApi.mainModule.start('startNodeWeb'); +dbgateApi.getMainModule().start('startNodeWeb');