Chapter 3. Let's Chat

Beginning with Yahoo! Chat in the early 2000 and up to today's popular Google Talk or Facebook Chat, chatting has been the most popular form of real-time communication on the Internet. In this chapter, we will build a chat room using node and express, which we learned in the previous chapter, and the socket.io library that we will learn in this chapter.

Creating the application

Similar to the way we created our application in the previous chapter, we will create a new awesome-chat application by executing the following commands in the command line:

$ express awesome-chat
$ cd awesome-chat
$ npm install

This will create our application and install the express application dependencies. Open the package.json file and change the name to awesome-chat, as shown in the following code snippet:

{ 
  "name": "awesome-chat", 
  "version": "0.0.1", 
  "private": true, 
  "scripts": { 
    "start": "node app" 
  }, 
  "dependencies": { 
    "express": "3.0.0rc2express": "3.x", 
    "jade": "*" 
  } 
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset