Book Image

Learn Node.js by Building 6 Projects

By : Eduonix Learning Solutions
Book Image

Learn Node.js by Building 6 Projects

By: Eduonix Learning Solutions

Overview of this book

<p>With its event-driven architecture and efficient web services capabilities, more and more companies are building their entire infrastructure around Node.js. Node has become a de facto part of web development that any serious developer needs to master.</p> <p>This book includes six Node.js projects that gradually increase in complexity. You'll start by building a simple web server and create a basic website. You will then move to create the login system, blog system, chat system, and e-learning system.</p> <p>By creating and following the example projects in this book, you’ll improve your Node.js skills through practical working projects, and you'll learn how to use Node.js with many other useful technologies, such as ExpressJS, Kickstart, and Heroku.</p>
Table of Contents (12 chapters)

The ChatIO user interface


In this project, we'll create a chat application. This is going to be a little different than what we than we've done in any of the previous projects, and that's because we'll be using WebSockets, more specifically we'll be using socket.io. WebSockets allows us to communicate have the client and server in a different way.

There will be an open connection between the client and server. Instead of just making request-response, there will be an open connection, and that makes everything completely instant. So we can send messages to the server, and it'll update all the other clients that are connected. We'll also be able to open a tab and write a message, and open another tab and be viewing the application as a different user. Then if one user replies or writes in a message, the other one will update automatically without even having to reload.

WebSockets is a really nice technology to learn, and it's actually really easy; it's basically just events. You call separate...