Skip to content

Instantly share code, notes, and snippets.

@steam0
Created April 22, 2016 06:14
Show Gist options
  • Save steam0/9dbe5c260da60455c14741ae8d661f67 to your computer and use it in GitHub Desktop.
Save steam0/9dbe5c260da60455c14741ae8d661f67 to your computer and use it in GitHub Desktop.
/* Telldus REST api */
app.get('/listClients', function (request, response) {
cloud.getDevices(function(err, devices) {
if (!!err) {
return console.log('getDevices: ' + err.message);
}
response.end(JSON.stringify(devices));
});
})
/* Hue REST API */
app.get('/hue/lights', function (request, response) {
console.log(request.query)
if (!hue_online) {
hue_error(response)
return
}
HueApi.lights(function(lights) {
response.end(JSON.stringify(lights))
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment