web can be run from dbgate package

This commit is contained in:
Jan Prochazka
2021-02-08 17:55:09 +01:00
parent 2c6a59638b
commit d88591032e
3 changed files with 10 additions and 15 deletions

View File

@@ -1,10 +1,5 @@
const shell = require('./shell');
// require('socket.io-client');
// "socket.io-client": "^2.3.0",
// "utf-8-validate": "^5.0.2",
// "uuid": "^3.4.0",
// "uws": "10.148.1"
const main = require('./main');
const argument = process.argv[2];
if (argument && argument.endsWith('Process')) {
@@ -13,7 +8,6 @@ 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);
}

View File

@@ -83,9 +83,11 @@ function start(argument = null) {
// server static files inside docker container
app.use(express.static('/home/dbgate-docker/build'));
} else {
app.get('/', (req, res) => {
res.send('DbGate API');
});
if (argument != 'startNodeWeb') {
app.get('/', (req, res) => {
res.send('DbGate API');
});
}
}
if (argument == '--dynport') {
@@ -102,7 +104,6 @@ function start(argument = null) {
findFreePort(5000, function (err, port) {
server.listen(port, () => {
console.log(`DbGate API listening on port ${port}`);
process.send({ msgtype: 'listening', port });
});
});
} else {