added default config file
This commit is contained in:
parent
f8ce292866
commit
1cf9d7bd57
0
.node-xmlhttprequest-sync-99320
Normal file
0
.node-xmlhttprequest-sync-99320
Normal file
11
app.js
11
app.js
@ -3,8 +3,17 @@ var path = require('path');
|
||||
var favicon = require('serve-favicon');
|
||||
var logger = require('morgan');
|
||||
var bodyParser = require('body-parser');
|
||||
var fs = require('fs');
|
||||
|
||||
var config = require('./config/nodes');
|
||||
var config;
|
||||
|
||||
if(fs.existsSync('./config/nodes.js')){
|
||||
config = require('./config/nodes');
|
||||
} else {
|
||||
config = require('./config/nodes.default');
|
||||
}
|
||||
console.log(config);
|
||||
// var config = require('./config/nodes');
|
||||
var Node = require('./models/node');
|
||||
|
||||
var app = express();
|
||||
|
16
config/nodes.default.js
Normal file
16
config/nodes.default.js
Normal file
@ -0,0 +1,16 @@
|
||||
var nodes = [
|
||||
// {
|
||||
// name: 'Readable name of the node',
|
||||
// type: 'C++/Go...',
|
||||
// rpcHost: 'your node IP here',
|
||||
// rpcPort: 'JSON-RPC port here'
|
||||
// },
|
||||
{
|
||||
name: 'local',
|
||||
type: 'C++',
|
||||
rpcHost: 'localhost',
|
||||
rpcPort: '8080'
|
||||
}
|
||||
];
|
||||
|
||||
module.exports = nodes;
|
@ -1,28 +0,0 @@
|
||||
var nodes = [
|
||||
{
|
||||
name: 'instance 1',
|
||||
type: 'C++',
|
||||
rpcHost: '54.173.252.182',
|
||||
rpcPort: '8080'
|
||||
},
|
||||
{
|
||||
name: 'instance 2',
|
||||
type: 'C++',
|
||||
rpcHost: '54.209.133.248',
|
||||
rpcPort: '8080'
|
||||
},
|
||||
{
|
||||
name: 'instance 3',
|
||||
type: 'C++',
|
||||
rpcHost: '54.174.67.126',
|
||||
rpcPort: '8080'
|
||||
},
|
||||
{
|
||||
name: 'local',
|
||||
type: 'C++',
|
||||
rpcHost: 'localhost',
|
||||
rpcPort: '8080'
|
||||
}
|
||||
];
|
||||
|
||||
module.exports = nodes;
|
Loading…
Reference in New Issue
Block a user