Skip to content

Commit

Permalink
Created V1 Experimental Discovery Node
Browse files Browse the repository at this point in the history
  • Loading branch information
chughts committed Nov 10, 2016
1 parent 70a4be6 commit 16a2ee5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions services/discovery/v1-exp.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
module.exports = function (RED) {

function buildParams(msg,config) {
params = {};
var params = {};
if (msg.discoveryparams && msg.discoveryparams.envrionmentname) {
params.name = msg.discoveryparams.envrionmentname;
} else if (config.envrionmentname) {
Expand Down Expand Up @@ -70,20 +70,19 @@ module.exports = function (RED) {
node.status({fill:'blue', shape:'dot', text:'requesting'});

discovery.getEnvironments(params, function (err, response) {
node.status({})
node.status({});
if (err) {
console.log(err);
node.status({fill:'red', shape:'dot', text:err.error});
node.error(err, msg);
} else {
console.log(response);
msg.environments = response.environments ? response.environments : [];
msg.environments = response.environments ? response.environments : [];
}
node.send(msg);
});
});
}

RED.nodes.registerType('watson-discovery', Node, {
credentials: {
username: {type:'text'},
Expand Down

0 comments on commit 16a2ee5

Please sign in to comment.