diff --git a/package.json b/package.json index 8d195fc..f583275 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/server.js b/src/server.js index 22154a7..e4754d9 100644 --- a/src/server.js +++ b/src/server.js @@ -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/')