Get Programming with Node.js
Jonathan Wexler
  • MEAP began July 2017
  • Publication in February 2019 (estimated)
  • ISBN 9781617294747
  • 480 pages (estimated)
  • printed in black & white

...easy to read style and lots of short cuts I didn't know about that makes coding a lot quicker & convenient...

Aindriu Mac Giolla Eoin

Get Programming with Node.js teaches you to write server-side code in JavaScript using Node.js. In 34 fast-paced, fun, and practical lessons, you'll discover how to extend your existing JavaScript skills to write back-end code for your web applications. After setting up the perfect developer environment, you'll get straight into developing your first app using Express.js, a lightweight MVC-style web framework. You'll learn all-important security and authentication features, as well as database tasks. When your basic app is completed, you'll add extra functionality like chat before deploying the finished product. Thanks to the easy-to-digest examples and exercises, you'll be coding with Node.js like a pro in no time!

Table of Contents detailed table of contents

Unit 0: Getting Set Up

Lesson 0: Setting up Node.js and the JavaScript Engine

What you’re going to learn

Understanding Node.js

Why learn to develop in Node.js?

Preparing yourself for this book


Lesson 1: Configuring your environment

Installing Node.js

Installing a text editor

Setting up SCM and deployment tools

Working with the Node.js REPL in terminal


Lesson 2: Running a Node.js application

Creating a JavaScript file

Running your JavaScript file with Node.js

Running Individual JavaScript Commands


Unit 1: Getting Started with Node.js

Lesson 3: Creating a Node.js module

Running npm commands

Initializing a Node.js application


Lesson 4: Building a simple web server in Node.js

Understanding web servers

Initialize the application with npm

Coding the application

Running the application


Lesson 5: Handling incoming data

Reworking your server code

Analyzing request data

Adding Routes to a Web Application


Lesson 6: Writing better routes and serving external files

Serving static files with the fs module

Serving assets

Moving your routes to another file


Lesson 7: Capstone: Creating your first web application

Initializing the application

Understanding application directory structure

Creating main.js and router.js

Creating views

Adding Assets

Creating routes


Unit 2: Easier Web Development with Express

Lesson 8: Setting up an app with Express.js

Installing the Express.js package

Building your first Express.js application

Working your way around a web framework


Lesson 9: Routing in Express.js

Building routes with Express.js

Analyzing Request data

Using MVC


Lesson 10: Connecting views with templates

Connecting a templating engine

Passing data from your controllers

Setting up partials and layouts


Lesson 11: Configurations and error handling

Modifying your start script

Handling errors with Express.js

Serving static files


Lesson 12: Capstone: Enhancing the Confetti Cuisine site with Express.js

Initializing the application

Building the application

Adding more routes

Routing to views

Serving static views

Passing content to the views

Handle the errors


Unit 3: Connecting to a database

Lesson 13: Setting up a MongoDB database

Setting up MongoDB

Running commands in the MongoDB shell

Connecting MongoDB to your application


Lesson 14: Building Models with Mongoose

Setting up Mongoose with your Node.js application

Creating a schema

Organizing your models


Lesson 15: Connecting Controllers and Models

Creating a controller for subscribers

Saving posted data to a model

Using promises with Mongoose


Lesson 16: Capstone: Saving user subscriptions

Setting up the database

Modeling data

Adding a subscriber views and routes


Unit 4: Building a user model

Lesson 17: Improving your data models

Adding validations on the model

Testing models in REPL

Creating model associations

Populating data from associated models


Lesson 18: Building the user model

Building the user model

Adding CRUD methods to your models

Building the index page

Cleaning up your actions


Lesson 19: Creating and reading your models

Building the new user form

Creating new users from a view

Reading user data with show


Lesson 20: Updating and deleting your models

Building the edit user form

Updating users from a view

Deleting users with the delete action


Lesson 21:Capstone: Adding CRUD models to Confetti Cuisine

Getting set up

Building the models

Creating the views

Structuring routes

Creating controllers


Unit 5: Authenticating user accounts

Lesson 22: Adding sessions and flash messages

Setting up flash message modules

Adding flash messages to controller actions


Lesson 23: Building a user login and hashing passwords

Implementing the user login form

Hashing passwords

Adding validation middleware with express-validator


Lesson 24: Adding user authentication

Implementing Passport.js

Modifying the create action to use passport registration

Authenticating users at login


Lesson 25: Capstone: Adding user authentication to Confetti Cuisine

25.1 Getting set up

25.2 Creating a login form

25.3 Adding encryption with Passport.js

25.4 Adding flash messaging

25.5 Adding validation middleware with express-validator

25.6 Adding authentication with Passport.js

25.7 Logging in and out

Unit 6: Building an API

Lesson 26: Adding an API to your application

Organizing your routes

Creating an API

Calling your API from the client


Lesson 27: Acccessing your API from your application

Applying an API namespace

Joining groups via modal

Creating an API endpoint to connect models


Lesson 28: Adding API security

Implementing simple security

Adding API tokens

Using JSON web tokens


Lesson 29: Capstone: Implementing an API

Restructuring routes

Adding the courses partial

Creating the AJAX function

Adding an API endpoint

Creating an action to enroll users


Unit 7: Adding Chat functionality

Lesson 30: Working with


Creating a chat box

Connecting the server and client


Lesson 31: Saving chat messages

Connecting messages to users

Displaying user names in chat

Creating a message model


Lesson 32: Adding a chat notification indicator

Broadcasting to all other sockets

Creating a chat indicator in navigation


Lesson 33: Capstone: Adding a chat feature to Confetti Cuisine


Setting up on the server

Setting up on the client

Creating a message model

Loading messages on connection

Setting up the chat icon


Unit 8: Deploying and managing code in production

Lesson 34: Deploying your application

Preparing for deployment

Deploying your application

Setting up your database in production


Lesson 35: Managing in production

Loading seed data


Debugging your application


Lesson 36: Testing your application

Basic testing with core modules

Testing with mocha and chai

Testing with a database and server


Lesson 37: Capstone: Deploying Confetti Cuisine

37.1 Linting and logging

37.2 Preparing for production

37.3 Deploying to Heroku

37.4 Setting up the database

37.5 Debugging in production

37.6 Summary

Unit A: Appendixes

Appendix A: JavaScript syntax introduced in ES6

New in ES6

The let keyword

The const variable

String Interpolation

Arrow Functions


Running JavaScript in REPL

Using REPL in application development


Appendix B: Logging and using Node.js global objects


Global objects

About the Technology

Why use several languages for a web application when you only need one? Node.js is a server-side platform and runtime that you can use to build full stack web applications entirely in JavaScript! Node supports scalable, high-performance applications with easy asynchronous communication, an event-driven mindset, and a vast ecosystem of tools and modules. Node can handle the real-time response rates that games, chat sites, and statistical services need, and you get to program everything in JavaScript.

What's inside

  • Setting up your Node development environment
  • Creating a simple web server
  • Working with Express.js
  • Saving application data to a MongoDB database
  • Building a complete REST API
  • Deploying the finished product
  • Debugging your app in production order

About the reader

Written for developers who know HTML, CSS, and JavaScript. No prior experience with Node.js is required.

About the author

Jonathan Wexler has an extensive background in computer theory and web development. Having curated a Node.js curriculum as the academic director and lead developer for The New York Code and Design Academy, Jonathan has instructed multiple intensive programs in full stack development and currently works as a senior developer for Bloomberg LP.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.

placing your order...

Don't refresh or navigate away from the page.

FREE domestic shipping on three or more pBooks

Takes you from knowing nothing to serving web pages using Node.js.

Roger Sperberg

If you are a web developer and want to get into Node.js, this book is a very good option for you.

Vinicius Miana Bezerra