19 lines
461 B
JavaScript
19 lines
461 B
JavaScript
|
|
||
|
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);
|
||
|
}
|