diff options
Diffstat (limited to 'static/src/main.ts')
| -rw-r--r-- | static/src/main.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/static/src/main.ts b/static/src/main.ts new file mode 100644 index 0000000..8d12587 --- /dev/null +++ b/static/src/main.ts @@ -0,0 +1,18 @@ +import $ from "jquery"; + +$(document).ready(async () => { + await fetch("/assign", { + credentials: "include", + }); + + const ws = new WebSocket("/ws"); + ws.onopen = () => { + console.log("connected"); + }; + ws.onmessage = ({ data }) => { + console.log(JSON.parse(data)); + }; + ws.onclose = (e) => { + console.log("disconnected", e); + }; +}); |
