dbgate-api 4.7.4-alpha.10 → 4.7.4-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dbgate-api",
3
3
  "main": "src/index.js",
4
- "version": "4.7.4-alpha.10",
4
+ "version": "4.7.4-alpha.12",
5
5
  "homepage": "https://dbgate.org/",
6
6
  "repository": {
7
7
  "type": "git",
@@ -25,9 +25,9 @@
25
25
  "compare-versions": "^3.6.0",
26
26
  "cors": "^2.8.5",
27
27
  "cross-env": "^6.0.3",
28
- "dbgate-query-splitter": "^4.7.4-alpha.10",
29
- "dbgate-sqltree": "^4.7.4-alpha.10",
30
- "dbgate-tools": "^4.7.4-alpha.10",
28
+ "dbgate-query-splitter": "^4.7.4-alpha.12",
29
+ "dbgate-sqltree": "^4.7.4-alpha.12",
30
+ "dbgate-tools": "^4.7.4-alpha.12",
31
31
  "diff": "^5.0.0",
32
32
  "diff2html": "^3.4.13",
33
33
  "eslint": "^6.8.0",
@@ -63,7 +63,7 @@
63
63
  "devDependencies": {
64
64
  "@types/fs-extra": "^9.0.11",
65
65
  "@types/lodash": "^4.14.149",
66
- "dbgate-types": "^4.7.4-alpha.10",
66
+ "dbgate-types": "^4.7.4-alpha.12",
67
67
  "env-cmd": "^10.1.0",
68
68
  "node-loader": "^1.0.2",
69
69
  "nodemon": "^2.0.2",
@@ -111,7 +111,7 @@ module.exports = {
111
111
  stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
112
112
  env: {
113
113
  ...process.env,
114
- DBGATE_API: global['API_PACKAGE'] || global['dbgateApiModulePath'] || process.argv[1],
114
+ DBGATE_API: global['API_PACKAGE'] || process.argv[1],
115
115
  ..._.fromPairs(pluginNames.map(name => [`PLUGIN_${_.camelCase(name)}`, getPluginBackendPath(name)])),
116
116
  },
117
117
  }
@@ -1,5 +1,5 @@
1
1
 
2
2
  module.exports = {
3
- version: '4.7.4-alpha.10',
4
- buildTime: '2022-03-21T19:56:58.513Z'
3
+ version: '4.7.4-alpha.12',
4
+ buildTime: '2022-03-24T08:15:55.138Z'
5
5
  };
package/src/index.js CHANGED
@@ -8,7 +8,7 @@ if (processArgs.startProcess) {
8
8
  const proc = require('./proc');
9
9
  const module = proc[processArgs.startProcess];
10
10
  module.start();
11
- } else if (!processArgs.checkParent && !global['API_PACKAGE'] && !global['dbgateApiModulePath']) {
11
+ } else if (!processArgs.checkParent && !global['API_PACKAGE']) {
12
12
  const main = require('./main');
13
13
 
14
14
  main.start();
package/src/main.js CHANGED
@@ -86,6 +86,10 @@ function start() {
86
86
  if (platformInfo.isDocker) {
87
87
  // server static files inside docker container
88
88
  app.use(getExpressPath('/'), express.static('/home/dbgate-docker/public'));
89
+
90
+ const port = process.env.PORT || 3000;
91
+ console.log('DbGate API listening on port', port);
92
+ server.listen(port);
89
93
  } else if (platformInfo.isNpmDist) {
90
94
  app.use(getExpressPath('/'), express.static(path.join(__dirname, '../../dbgate-web/public')));
91
95
  getPort({
@@ -54,7 +54,7 @@ function packagedPluginsDir() {
54
54
  }
55
55
  if (platformInfo.isNpmDist) {
56
56
  // node_modules
57
- return global['dbgateApiPackagedPluginsPath'];
57
+ return global['PLUGINS_DIR'];
58
58
  }
59
59
  if (platformInfo.isElectronBundle) {
60
60
  return path.resolve(__dirname, '../../plugins');
@@ -10,7 +10,7 @@ const isMac = platform === 'darwin';
10
10
  const isLinux = platform === 'linux';
11
11
  const isDocker = fs.existsSync('/home/dbgate-docker/public');
12
12
  const isDevMode = process.env.DEVMODE == '1';
13
- const isNpmDist = !!global['dbgateApiModulePath'];
13
+ const isNpmDist = !!global['IS_NPM_DIST'];
14
14
  const isForkedApi = processArgs.isForkedApi;
15
15
 
16
16
  // function moduleAvailable(name) {