zeus 4 years ago
parent
commit
be7a7c9aab
  1. 8
      swarmlab-app/src/run/app.js

8
swarmlab-app/src/run/app.js

@ -136,13 +136,19 @@ cors(corsOptions), (req, res, next) => {
for (var i = 0; i < req.body.length; i++){ for (var i = 0; i < req.body.length; i++){
var obj = req.body[i]; var obj = req.body[i];
var reslog = new Object(); var reslog = new Object();
reslog.message = obj
reslog.date = var d = new Date(year, month, day, hour, minute, second, millisecond);
io.emit("logdata", reslog);
/*
for (var key in obj){ for (var key in obj){
var value = obj[key]; var value = obj[key];
//console.log("line " + key + ": " + value); //console.log("line " + key + ": " + value);
reslog.key = key reslog.key = key
reslog.value = value reslog.value = value
io.emit("logdata", reslog); //io.emit("logdata", reslog);
} }
*/
} }
//io.in("iot").emit("message", RES); //io.in("iot").emit("message", RES);

Loading…
Cancel
Save