UNPKG

cmnode-smarthub-config

Version:

14 lines 504 B
module.exports = function(RED) { function SmarthubConfig(config) { RED.nodes.createNode(this,config); this.database_url = config.database_url; this.mode = config.mode var node = this; node.on('input', function(msg) { msg.payload = JSON.stringify({"database" : { "url": node.database_url} }); msg['mode'] = node.mode; node.send(msg); }); } RED.nodes.registerType("smarthub-config",SmarthubConfig); }