From 9d93f54621483942f75d4edd113f2cbdddd983fd Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Thu, 25 Aug 2016 12:02:59 +0100 Subject: [PATCH] Prep for bluemix deployment --- lib/mqtt/mqttClient.js | 4 +++- lib/server/db-connector.js | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/mqtt/mqttClient.js b/lib/mqtt/mqttClient.js index b69cdb6..b529fdb 100644 --- a/lib/mqtt/mqttClient.js +++ b/lib/mqtt/mqttClient.js @@ -84,7 +84,9 @@ var mqttClient = function() { var address = '.messaging.internetofthings.ibmcloud.com'; var appKey = '9txJEf3Cjy7hkSOvkv'; var prefix = 'iot-2/type/mDot/id/'; - var deviceId = ['CENSIS-LoRa-1','CENSIS-LoRa-2','CENSIS-LoRa-3','CENSIS-LoRa-4','HIE-mobile-1','HIE-mobile-2','HIE-smart-campus-1','HIE-smart-campus-2','HIE-smart-campus-3','HIE-smart-campus-4','HIE-smart-campus-5','HIE-smart-campus-6','HIE-smart-campus-7','HIE-mDot-1']; + //var deviceId = ['CENSIS-LoRa-1','CENSIS-LoRa-2','CENSIS-LoRa-3','CENSIS-LoRa-4','HIE-mobile-1','HIE-mobile-2','HIE-smart-campus-1','HIE-smart-campus-2','HIE-smart-campus-3','HIE-smart-campus-4','HIE-smart-campus-5','HIE-smart-campus-6','HIE-smart-campus-7','HIE-mDot-1']; + + var deviceId = ['CENSIS-LoRa-1','CENSIS-LoRa-2','CENSIS-LoRa-3','CENSIS-LoRa-4','HIE-mobile-1----','HIE-mobile-2----','HIE-smart-campus-1','HIE-smart-campus-2','HIE-smart-campus-3','HIE-smart-campus-4','HIE-smart-campus-5','HIE-smart-campus-6','HIE-smart-campus-7','HIE-mDot-1']; //Var subscribeTopic = prefix + deviceId + '/evt/+/fmt/json'; diff --git a/lib/server/db-connector.js b/lib/server/db-connector.js index 7ab3d2c..ca582ba 100644 --- a/lib/server/db-connector.js +++ b/lib/server/db-connector.js @@ -9,6 +9,7 @@ var pgp = require('pg-promise')(); +/* var cn = { host: 'localhost', port: 5432, @@ -16,6 +17,18 @@ var cn = { user: 'postgres', password: '' }; +*/ + +// ElephantSql settings + +var cn = { + host: 'qdjjtnkv.db.elephantsql.com', + port: 5432, + database: 'gxwxnqoh', + user: 'gxwxnqoh', + password: 'LN5Uk39GNcBCxCHv5dfL8aKuowFT6WKG' +}; + exports.dbConnection = pgp(cn);