Merge pull request #1022 from mmalmi/peers-env-variable

Peers env variable
This commit is contained in:
Mark Nadal 2020-11-09 13:18:34 -08:00 committed by GitHub
commit 564c6f3100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -5,7 +5,10 @@
}
var fs = require('fs');
var config = { port: process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8765 };
var config = {
port: process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8765,
peers: process.env.PEERS && process.env.PEERS.split(',') || []
};
var Gun = require('../'); // require('gun')
if(process.env.HTTPS_KEY){
@ -16,8 +19,8 @@
config.server = require('http').createServer(Gun.serve(__dirname));
}
var gun = Gun({web: config.server.listen(config.port)});
var gun = Gun({web: config.server.listen(config.port), peers: config.peers});
console.log('Relay peer started on port ' + config.port + ' with /gun');
module.exports = gun;
}());
}());

View File

@ -65,7 +65,6 @@
"buffer": "^5.4.3"
},
"peerDependencies": {
"@gooddollar/react-native-webview-crypto": "^0.*",
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2",
"text-encoding": "^0.7.0"