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

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.