Skip to content

Commit

Permalink
Moved the USERINFO inquiries to the top of the file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehran-S committed May 29, 2018
1 parent 415e9fa commit 84ecea8
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions RTView-Cumulocity-Node/cumulocity_connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ console.log('\n--- Cumulocity IoT / RTView Connector ---\n');

var request = require('request');
var rtvproxy = require('./rtview_cacheproxy.js');
var userinfo = require("./USERINFO.json");
//console.log('... userinfo = ' + JSON.stringify(userinfo));
var username = userinfo.username;
var password = userinfo.password;
var baseURL = userinfo.baseURL;

var auth = "Basic " + new Buffer(username + ":" + password).toString("base64");

// Cache definitions for data requested from Cumulocity IoT Server
// and returned to RTView.
Expand Down Expand Up @@ -212,16 +219,6 @@ rtvproxy.run(getData);
// **********************************************************************
// Cumulocity variables and support

//console.log('\nGet User Info -> USERINFO.json\n');

var userinfo = require("./USERINFO.json");
console.log('... userinfo = ' + JSON.stringify(userinfo));
var username = userinfo.username;
var password = userinfo.password;
var baseURL = userinfo.baseURL;

var auth = "Basic " + new Buffer(username + ":" + password).toString("base64");

var hasProperty = function(obj,prop) {
return Object.prototype.hasOwnProperty.call(obj,prop);
}
Expand Down

0 comments on commit 84ecea8

Please sign in to comment.