aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/index.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/static/index.js b/static/index.js
index 2c8ed38..ad39c4f 100644
--- a/static/index.js
+++ b/static/index.js
@@ -1,5 +1,12 @@
window.onload = () => {
- console.log('from js');
- const kennelWindowEle = document.querySelector('#kennel-window');
- kennelWindowEle.innerHTML = 'rendered from static/index.js';
-}
+ const ws = new WebSocket("/ws");
+ ws.onopen = () => {
+ console.log("connected");
+ };
+ ws.onmessage = (e) => {
+ console.log(e);
+ };
+ ws.onclose = (e) => {
+ console.log("disconnected", e);
+ };
+};