electron build uses random free port, fixes #142

This commit is contained in:
azivner
2018-07-31 19:50:18 +02:00
parent 365c37604b
commit 9452fc236b
5 changed files with 51 additions and 75 deletions

10
src/services/port.js Normal file
View File

@@ -0,0 +1,10 @@
const getPort = require('get-port');
const config = require('./config');
const utils = require('./utils');
if (utils.isElectron()) {
module.exports = getPort();
}
else {
module.exports = Promise.resolve(config['Network']['port'] || '3000');
}