Summary

In this chapter, you learned how to implement a simple monitor server that pushes data changes in real time to the client. We used Node.js because of its nonblocking I/O behavior and because of the fact that we can write the server code in JavaScript.

After installing Node.js and creating a package.json file for the application, we installed the express and serve-static web framework via the npm Node package manager.

We used the serve-static package to serve all the static files in the root directory of our application and added it as a middleware to express. This allows you to write a simple file server in less than 10 lines of code.

To implement real-time communication, we need a bidirectional connection rather than the unidirectional HTTP ...

Get Data Visualization with D3 and AngularJS 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.