Summary
In this chapter, we looked into adding a chat page. We'll built an HTML file and defined head
and body
tags as per our requirements. Then, we go ahead with passing the room data. We looked into the concept of params
and deparams
and created test cases for validating the data. In the last section, we discussed the socket.io
rooms. We targeting a specific user for the chat room and tested the set up.
Things were relatively easy for our join
event listener because we had access to both the name variable and the room variable. They were actually passed in as arguments. It's going to be a lot more difficult for createMessage
and createLocationMessage
. We'll need to figure out a way to get the room back for the given socket so we can emit
to just that room.
We also need to set up that People
list on the left-hand sidebar. We'll need to figure out how to use that io
object to get a list of all the people by room and their names. All of that is going to be super important because currently...