|
|
@ -136,13 +136,19 @@ cors(corsOptions), (req, res, next) => { |
|
|
|
for (var i = 0; i < req.body.length; i++){ |
|
|
|
var obj = req.body[i]; |
|
|
|
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){ |
|
|
|
var value = obj[key]; |
|
|
|
//console.log("line " + key + ": " + value);
|
|
|
|
reslog.key = key |
|
|
|
reslog.value = value |
|
|
|
io.emit("logdata", reslog); |
|
|
|
//io.emit("logdata", reslog);
|
|
|
|
} |
|
|
|
*/ |
|
|
|
} |
|
|
|
|
|
|
|
//io.in("iot").emit("message", RES);
|
|
|
|