I have created a chat. Everything is working. I can see the page that I wrote when I go to the link. but the thing is that I can’t see the chat that are sent. I don’t know why.
I did not thoroughly go through the code, but this stood out:
if(cht.value.trim()===""||un.value.trim==="")
Also, just for the sake of mentioning, it might help to name the server.js variables better. That is, having global- and block- scoped variables with the same handle can be confusing.
The pattern I am used to is:
const io = require('socket.io')(server);
// To avoid having a global 'socket' variable.