aboutsummaryrefslogtreecommitdiff
path: root/static/src/main.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-08-24 13:03:50 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-08-24 13:03:56 -0700
commit5dc264e08253c3a97ea41d1fde5fbf3f33dd6591 (patch)
tree0db325e5e280176702263d28817c371abce050db /static/src/main.ts
parent6f374aac7f4d553c484eecc77c9599be79f2d834 (diff)
downloadkennel.hatecomputers.club-5dc264e08253c3a97ea41d1fde5fbf3f33dd6591.tar.gz
kennel.hatecomputers.club-5dc264e08253c3a97ea41d1fde5fbf3f33dd6591.zip
bring in jQuery, build with Vite
Diffstat (limited to 'static/src/main.ts')
-rw-r--r--static/src/main.ts18
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);
+ };
+});