aboutsummaryrefslogtreecommitdiff
path: root/static/src/main.ts
blob: 8d12587bd021eb200536b30272aca5994e96677b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);
  };
});