npm build dbgate

This commit is contained in:
Jan Prochazka
2021-02-07 17:24:45 +01:00
parent f3163617e0
commit b60714f30c
9 changed files with 60 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ const io = require('socket.io');
const fs = require('fs');
const findFreePort = require('find-free-port');
const childProcessChecker = require('./utility/childProcessChecker');
const path = require('path');
const useController = require('./utility/useController');
const socket = require('./utility/socket');
@@ -96,6 +97,14 @@ function start(argument = null) {
process.send({ msgtype: 'listening', port });
});
});
} else if (argument == 'startNodeWeb') {
app.use(express.static(path.join(__dirname, '../../dbgate-web/build')));
findFreePort(5000, function (err, port) {
server.listen(port, () => {
console.log(`DbGate API listening on port ${port}`);
process.send({ msgtype: 'listening', port });
});
});
} else {
server.listen(3000);
}