added default config file

This commit is contained in:
Marian Oancea 2015-02-05 01:55:48 +02:00
parent f8ce292866
commit 1cf9d7bd57
4 changed files with 26 additions and 29 deletions

View File

11
app.js
View File

@ -3,8 +3,17 @@ var path = require('path');
var favicon = require('serve-favicon'); var favicon = require('serve-favicon');
var logger = require('morgan'); var logger = require('morgan');
var bodyParser = require('body-parser'); 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 Node = require('./models/node');
var app = express(); var app = express();

16
config/nodes.default.js Normal file
View 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;

View File

@ -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;