embark/lib/modules/webserver/backend/index.html

23 lines
394 B
HTML
Raw Normal View History

Welcome to Embark!
2018-02-26 14:45:46 +00:00
<script>
2018-02-26 22:44:09 +00:00
var ws = new WebSocket("ws://localhost:8000/embark/logs");
2018-02-26 14:45:46 +00:00
2018-02-26 22:44:09 +00:00
ws.onopen = function() {
};
2018-02-26 14:45:46 +00:00
2018-02-26 22:44:09 +00:00
ws.onmessage = function (evt) {
var received_msg = evt.data;
console.log(JSON.parse(received_msg));
2018-02-26 22:44:09 +00:00
};
2018-02-26 14:45:46 +00:00
2018-02-26 22:44:09 +00:00
ws.onclose = function() {
console.log("Connection is closed...");
};
2018-02-26 14:45:46 +00:00
2018-02-26 22:44:09 +00:00
window.onbeforeunload = function(event) {
ws.close();
};
2018-02-26 14:45:46 +00:00
</script>