From be7a7c9aab92b6bbced86bfe8932b2a99b35d1ba Mon Sep 17 00:00:00 2001 From: zeus Date: Tue, 17 Nov 2020 23:49:08 +0200 Subject: [PATCH] add --- swarmlab-app/src/run/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 666d49c..db36ccb 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -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);