From 2906fbc5296631e75a7fd7f4b76861accf51ce69 Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Sun, 29 Sep 2024 22:11:58 -0400 Subject: [PATCH] Start building the frontend application. --- chat-app/static/index.html | 13 +++++++++++-- chat-app/static/js/chat-service.js | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/chat-app/static/index.html b/chat-app/static/index.html index 3e38662..da07796 100644 --- a/chat-app/static/index.html +++ b/chat-app/static/index.html @@ -9,12 +9,21 @@ diff --git a/chat-app/static/js/chat-service.js b/chat-app/static/js/chat-service.js index e8ddd0d..37d598a 100644 --- a/chat-app/static/js/chat-service.js +++ b/chat-app/static/js/chat-service.js @@ -1,3 +1,5 @@ +const ws = initChatService(); + function initChatService() { const ws = new WebSocket("ws://localhost:3000/chat-socket"); @@ -14,4 +16,6 @@ function initChatService() { ws.onerror = function (event) { console.log(event); }; + + return ws; }