Book Image

Node.js Web Development - Third Edition

By : David Herron
Book Image

Node.js Web Development - Third Edition

By: David Herron

Overview of this book

Node.js is a server-side JavaScript platform using an event driven, non-blocking I/O model allowing users to build fast and scalable data-intensive applications running in real time. Node.js Web Development shows JavaScript is not just for browser-side applications. It can be used for server-side web application development, real-time applications, microservices, and much more. This book gives you an excellent starting point, bringing you straight to the heart of developing web applications with Node.js. You will progress from a rudimentary knowledge of JavaScript and server-side development to being able to create and maintain your own Node.js application. With this book you'll learn how to use the HTTP Server and Client objects, data storage with both SQL and MongoDB databases, real-time applications with Socket.IO, mobile-first theming with Bootstrap, microservice deployment with Docker, authenticating against third-party services using OAuth, and much more.
Table of Contents (18 chapters)
Node.js Web Development Third Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Introducing Socket.IO


The aim of Socket.IO is:

To make real time apps possible in every browser and mobile device.

It supports several transport protocols, choosing the best one for the specific browser.

If you were to implement your application with WebSocket, it would be limited to the modern browsers supporting that protocol. Because Socket.IO falls back on so many alternate protocols (WebSockets, Flash, XHR, and JSONP), it supports a wide range of web browsers, including some old crufty browsers. Older Socket.IO versions claimed to support back to Internet Explore 5.5, but that claim is no longer printed on their website.

As the application author, you don't have to worry about the specific protocol Socket.IO uses in a given browser. Instead, you can implement the business logic and the library takes care of the details for you.

Socket.IO requires that a client library make its way into the browser. That library is provided, and it is easy to instantiate. You'll be writing code on both the...