diff --git a/config.template.js b/config.template.js index 0628849f0..f97bc0ae8 100644 --- a/config.template.js +++ b/config.template.js @@ -1,6 +1,7 @@ 'use strict'; -var config = { +var localConfig = JSON.parse(localStorage.getItem('config')); +var defaultConfig = { networkName: 'testnet', network: { // key: 'lwjd5qra8257b9', //Copay API key for public PeerJS server @@ -11,7 +12,7 @@ var config = { //path: '/', // key: 'g23ihfh82h35rf', // api key for the peerjs server - host: '162.242.219.26', // peerjs server + host: '162.242.245.33', // peerjs server port: 10009, path: '/', maxPeers: 15, @@ -105,6 +106,18 @@ var config = { verbose: 1, }; +var config = defaultConfig; + +// Merge localConfig +if (localConfig) { + var count = 0; + for (name in localConfig) { + if (localConfig.hasOwnProperty(name)) { + config[name] = localConfig[name]; + } + } +} + var log = function() { if (config.verbose) console.log(arguments); } diff --git a/index.html b/index.html index 03ad905be..57a600cda 100644 --- a/index.html +++ b/index.html @@ -25,6 +25,8 @@ + @@ -199,6 +201,7 @@