What this book covers
Chapter 1, About Node.js, introduces you to the Node.js platform. It covers its uses, the technological architecture choices in Node.js, its history, the history of server-side JavaScript, and why JavaScript should be liberated from the browser.
Chapter 2, Setting up Node.js, goes over setting up a Node.js developer environment. This includes installing Node.js on Windows, Mac OS X, and Linux, the command-line tools using ECMA Script 2015 features in Node.js, and the npm package management system.
Chapter 3, Node.js Modules, explores the module as the unit of modularity of Node.js applications. We dive deep into understanding and developing Node.js modules and using npm to maintain our dependency list.
Chapter 4, HTTP Servers and Clients – A Web Applications First Steps, starts exploring web development with Node.js. We develop several small webserver and client applications in Node.js. We use the Fibonacci algorithm to explore the effects of heavy-weight long-running computations on a Node.js application, as well as several mitigation strategies. This gives us our first exposure to REST-based service development.
Chapter 5, Your First Express Application, begins several chapters of developing a note-taking application. The first step is getting a basic application running.
Chapter 6, Implementing the Mobile-First Paradigm, uses the Bootstrap framework to implement responsive web design. Supporting mobile devices from the outset is a driving paradigm in modern software development.
Chapter 7, Data Storage and Retrieval, ensures that we don't lose our notes when restarting the application. We explore several database engines, and a method to make it easy to switch between them at will.
Chapter 8, Multiuser Authentication the Microservice Way, adds user authentication to the note-taking application. It can be used by both logged in and anonymous users with different capabilities for each. Authentication is supported against both a local user registry and using OAuth2 against Twitter.
Chapter 9, Dynamic Interaction between Client and Server with Socket.IO, lets our users talk to each other in real time. JavaScript code will be written in both browser and server, with Socket.IO providing the plumbing needed for real-time event exchange. Users will see notes change as they're edited by other users, or they will read and write notes that others can see.
Chapter 10, Deploying Node.js Applications, helps us understand Node.js application deployment. We look at both traditional Linux service deployment using an /etc/init
script and using Docker to easily deploy an infrastructure of two databases and two Node.js services.
Chapter 11, Unit Testing, takes a look at three test development models: Unit Testing, REST testing, and functional testing. In addition to the Mocha and Chai frameworks, we use CasperJS to run automated tests in a headless browser component. Docker is used to facilitate test infrastructure deployment.