Companion repository to Web Development With Node and Express, first edition.
This is the companion repository to Web Development With Node and Express, 1st Edition. With this repository, you can follow along with any of the code samples in the book, as well as see additional material that wasn't appropriate for the book format.
The first version of the book attempted to treat the repo as a linear development effort. That is, it attempted to mirror the progress a reader might make as he or she went through the book...or the progress a real development effort might take. This approach was well-intentioned, but turned out to cause more problems than it solved. After struggling with those problems, I realized that compromises had to be made to reflect the reality of this repo (including the amount of time I have to maintain this repo). Instead of a linear commit history with tags for each chapter, each chapter now lives in its own directory (including an "alternate ending" chapter, ch-08-jquery-file-upload
). Tags now represent "versions". The nice thing about versions is that the version of the book you're reading can be correlated to the version of the repository. For example, if your book says to use version 1.5, you can checkout tag 1.5, and feel confident that the code will mirror what you're reading.
Benefits of this approach:
After checking for typos, try the following steps:
npm install
with the specific package version (e.g. npm install --save [email protected]
).latest commit
on the right side of the window to see the newest changes to the code in this chapter => a red background means that the code was deleted and you should delete it too. A green background means that this is new code that was added and, likewise, you should add it. To reiterate the previous section: beyond the specific version tag that matches your copy of the book (1.5.1, for example) you may see code changes that don't match.I am happy to accept PRs for this repository, for changes big and small. Please keep in mind, however, that changes to the repository have to be kept in sync with changes in the book. Any work you can do in your PR to make it clear to me what changes need to be made in the book is very helpful to me. Before sending a PR, please consider the following:
ch05
, make sure you make the same changes in ch06
to ch19
. This is one of the first things I'll check in your PR.Many of the questions I receive have to do with the chapter sample code not working "out of the box." Most of these are because the reader hasn't taken note that you have to create your own credentials.js
file. The sample project relies on a lot of third-party services: Twitter, Google, MongoLabs, Weather Underground, etc. Not only do I not wish to share my personal access tokens for these sites, it would be against the terms of service for those sites. The book has instructions for creating your own credentials.js
and attaching to the appropriate account(s) you'll need. This important file doesn't show up until ch09
, so if you just want to get something up and running without any work, try one of the early chapters. Starting with ch09
, you've got to do a little work yourself to get the site running.
The original master
branch that I developed for the first version of the book has been saved as the legacy
branch. Please do NOT do any development on this branch; it is only there for reference. I will NOT consider any PRs from this branch.