clean up backend routes
This commit is contained in:
parent
da16d2366b
commit
2738141f21
1 changed files with 5 additions and 9 deletions
|
@ -13,17 +13,13 @@ router.get('/', function(req, res, next) {
|
|||
res.render('index', { title: 'Express' });
|
||||
});
|
||||
|
||||
router.get('/toggleLight', function (req, res) {
|
||||
/*var s = "0FFF0FFF000F";
|
||||
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) {
|
||||
router.get('/getRCs', function (req, res) {
|
||||
rc_db.findAll(function (error, results, fields) {
|
||||
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) {
|
||||
|
|
Reference in a new issue