close child process - api

This commit is contained in:
Jan Prochazka 2020-05-01 09:37:58 +02:00
parent 933f29afda
commit 44c19ad277

View File

@ -5,6 +5,7 @@ const cors = require('cors');
const io = require('socket.io'); const io = require('socket.io');
const fs = require('fs'); const fs = require('fs');
const findFreePort = require('find-free-port'); const findFreePort = require('find-free-port');
const childProcessChecker = require('./utility/childProcessChecker');
const useController = require('./utility/useController'); const useController = require('./utility/useController');
const socket = require('./utility/socket'); const socket = require('./utility/socket');
@ -44,6 +45,8 @@ function start(argument = null) {
} }
if (argument == '--dynport') { if (argument == '--dynport') {
childProcessChecker();
findFreePort(53911, function (err, port) { findFreePort(53911, function (err, port) {
server.listen(port, () => { server.listen(port, () => {
console.log(`DbGate API listening on port ${port}`); console.log(`DbGate API listening on port ${port}`);