diff --git a/lib/modules/webserver/backend/index.html b/lib/modules/webserver/backend/index.html index 3deda358..bfacb2bf 100644 --- a/lib/modules/webserver/backend/index.html +++ b/lib/modules/webserver/backend/index.html @@ -8,7 +8,7 @@ Welcome to Embark! ws.onmessage = function (evt) { var received_msg = evt.data; - console.log(received_msg); + console.log(JSON.parse(received_msg)); }; ws.onclose = function() { diff --git a/lib/modules/webserver/server.js b/lib/modules/webserver/server.js index 5fafb6de..f8949732 100644 --- a/lib/modules/webserver/server.js +++ b/lib/modules/webserver/server.js @@ -69,12 +69,12 @@ class Server { this.app.ws('/logs', function(ws, req) { self.events.on("log", function(logLevel, logMsg) { - ws.send(logMsg.stripColors); + ws.send(JSON.stringify({msg: logMsg, msg_clear: logMsg.stripColors, logLevel: logLevel}), () => {}); }); ws.on('message', function(msg) { console.dir("got message"); console.dir(msg); - ws.send(msg); + ws.send(msg, () => {}); }); });