Contents
Chapter 1: Setting up Node.js and Other Essentials
Installing with HomeBrew or MacPorts
Alternative Multiversion Systems
Buffer—Node.js Super Data Type
Node.js Globals and Reserved Keywords
Browser Application Programming Interface Helpers
Reading to and Writing from the File System in Node.js
Installing Node.js Modules with NPM
Hello World Server with HTTP Node.js Module
Chapter 2: Using Express.js 4 to Create Node.js Web Apps
Express.js Command-Line Interface
Middleware as the Backbone of Express.js
Configuration of an Express.js App
Jade Is Haml for Express.js/Node.js
Express.js 4 Hello World Example
Dependency Declaration: npm install
Meet Jade: One Template to Rule Them All
Chapter 3: TDD and BDD for Node.js with Mocha
Installing and Understanding Mocha
Project: Writing the First BDD Test for Blog
Putting Configs into a Makefile
Chapter 4: Template Engines: Jade and Handlebars
Jade and Handlebars Usage in Express.js 4
Project: Adding Jade Templates to Blog
Chapter 5: Persistence with MongoDB and Mongoskin
Easy and Proper Installation of MongoDB
Data Manipulation from the Mongo Console
Minimalistic Native MongoDB Driver for Node.js Example
Project: Storing Blog Data in MongoDB with Mongoskin
Project: Adding MongoDB Seed Data
Chapter 6: Using Sessions and OAuth to Authorize and Authenticate Users in Node.js Apps
Authorization with Express.js Middleware
Project: Adding E-mail and Password Login to Blog
Twitter OAuth 2.0 Example with Node.js OAuth
Project: Adding Twitter OAuth 1.0 Sign-in to Blog with Everyauth
Adding a Sign-in with a Twitter Link
Configuring the Everyauth Twitter Strategy
Chapter 7: Boosting Your Node.js Data with the Mongoose ORM Library
Connection Establishment in a Standalone Mongoose Script
Hooks for Keeping Code Organized
Custom Static and Instance Methods
Relationships and Joins with Population
Schema Type Behavior Amendment
Express.js + Mongoose = True MVC
Chapter 8: Building Node.js REST API Servers with Express.js and Hapi
Test Coverage with Mocha and Superagent
REST API Server Implementation with Express and Mongoskin
Refactoring: Hapi RESP API Server
Chapter 9: Real-Time Apps with WebSocket, Socket.IO, and DerbyJS
Native WebSocket and Node.js with the ws Module Example
Browser WebSocket Implementation
Node.js Server with ws Module Implementation
Socket.IO and Express.js Example
Collaborative Online Code Editor Example with DerbyJS, Express.js, and MongoDB
Project Dependencies and package.json
Chapter 10: Getting Node.js Apps Production Ready
Node.js Domains for Error Handling
Git for Version Control and Deployments
Creating a Local Git Repository
Pushing the Local Repository to GitHub
Running Tests in Cloud with TravisCI
Chapter 11: Deploying Node.js Apps
Deploying to Amazon Web Services
Keeping Node.js Apps Alive with forever, Upstart, and init.d
Serving Static Resources Properly with Nginx
Chapter 12: Publishing Node.js Modules and Contributing to Open Source
3.15.144.56