On Github KyperTech / HeartHubSlides
2 years
//import the library var heartHub = require('heartHub'); //create connection var connection = heartHub.connect('127.168.222.60:8888', 'admin', 'admin'); //create a service var glucoseService = heartHub.addService('Glucose'); //add a device to the service var glucoseDevice = radiationMonitor.addDevice('Dr. Newton'); //start the listener heartHub.init();
//import the library var heartHub = require('heartHub'); //create connection with db var connection = heartHub.connect('127.168.222.60:8888', 'admin', 'admin'); //retrieve avgerage glucose level for all devices (* for wildcard) var avgGlucose = connection.get('Glucose', *, 'glucose level').average(); //display on dashboard heartHub.template().push(avgGlucose);