clean up backend routes

This commit is contained in:
Shannon Sterz 2016-02-17 23:18:54 +01:00
parent da16d2366b
commit 2738141f21

View file

@ -13,17 +13,13 @@ router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' }); res.render('index', { title: 'Express' });
}); });
router.get('/toggleLight', function (req, res) { router.get('/getRCs', function (req, res) {
/*var s = "0FFF0FFF000F"; rc_db.findAll(function (error, results, fields) {
var str = "";
for(i = 0; i < s.length; i+=2) { str += String.fromCharCode(parseInt(s.substr(i,2), 16)); }
arduino.write(new Buffer('Wl' + str,'ascii'));
res.send('switch light');*/
rc_db.find(1, function (error, results, fields) {
if(error) console.log(error); if(error) console.log(error);
rc.send(results[0].on_value); //rc.send(results[0].on_value);
res.json(results);
}); });
res.send('switch light');
}); });
router.get('/irTest', function (req, res) { router.get('/irTest', function (req, res) {