Skip to content

Commit

Permalink
Added loop to read configuration as part of #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerard Moroney committed Dec 29, 2017
1 parent fe47d40 commit 4270e08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dependencies": {
"angularjs": "0.0.1",
"chai": "^4.1.2",
"config": "^1.29.0",
"express": "^4.15.2",
"redis": "^2.8.0",
"websockets": "^0.2.0",
Expand Down
12 changes: 11 additions & 1 deletion src/server.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
/*jshint esversion: 6 */

var sys = require('util');
var config = require('../config/default.json');

// Connect to Redis
var redis = require('redis');
var client = redis.createClient('6379','127.0.0.1');
var client = redis.createClient(config.redis.port,config.redis.host);
client.on('connect', function() {
console.log('Connected to Redis Server');
});

// Loop through exchanges (preparation for later)
for (var i=1; i < config.exchanges.length; i++ )
{
console.log("----------------");
console.log(config.exchanges[i]["name"]);
console.log(config.exchanges[i]["wssurl"]);
console.log(config.exchanges[i]["pairs"]);
};

// Connect to Exchange
const WebSocket = require('ws')
const wss = new WebSocket('wss://api.bitfinex.com/ws/')
Expand Down

0 comments on commit 4270e08

Please sign in to comment.