TempTracker/routes/tempdb.js

19 lines
461 B
JavaScript
Raw Normal View History

2015-01-28 07:21:10 +00:00
var sqlite3 = require("sqlite3");
exports.getAll = function(req, res) {
res.send([{id: '1', name: 'Wohnzimmer', temp: 20.1}, {id: '2', name: "Schlafzimmer", temp: 18.4}]);
}
exports.getTemp = function(req, res) {
res.send({id: req.params.id, temp: 20.1});
}
exports.addTemp = function(req, res) {
console.log("Adding Temp: " + req.body);
}
exports.updTemp = function(req, res) {
console.log("Updating Temp: " + req.params.id + " Data: " + req.body);
}