Building chat application with node.js, express and socket.io
Connect client sockets with server and make simple message communication between all sockets.
Example from Socket.io
Let's add nicknames support for chat and add some field validation, so you cannot send a message if a nickname or message field is empty.
Don’t send the same message to the user that sent it himself. Instead, append the message directly as soon as he presses enter.
Add online users list to the chat. If the users provide nickname, add him to the online users list.
Add chat history, so when next time you connect to chat you can see the last 20 messages.
Let's add 2 chat rooms. Global
and KaunasJS
. Each room have online users list and 20 message history. The user can be in only one room at a time.
Step 7: Host to Heroku
Host final step to Heroku.