From 252a783ab361e62990e31e5cbf483663548a34be Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 6 Dec 2022 20:18:59 -0800 Subject: [PATCH] Add a (half)-functional comment field This sends the comment from the client to the server (but not back again). The server process simply prints the comment out on its console. --- index.html | 17 +++++++++++++++++ index.js | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 5a74b47..b7b82de 100644 --- a/index.html +++ b/index.html @@ -64,6 +64,12 @@

+

+

+ +
+

+

@@ -100,6 +106,17 @@ mute.addEventListener("click", () => { diff --git a/index.js b/index.js index 336f36f..3ffea3d 100644 --- a/index.js +++ b/index.js @@ -12,9 +12,11 @@ app.get('/index.html', (req, res) => { io.on('connection', (socket) => { console.log('a user connected'); + socket.on('comment', (comment) => { + console.log('comment: ' + comment); + }); }); server.listen(port, () => { console.log(`listening on *:${port}`); }); - -- 2.43.0