356669 (1) [Avatar] Offline
Particular this bit of code on page 106/107:
router.use(function(req, res, next) {   
res.locals.currentUser = req.user;       #1
res.locals.errors = req.flash("error");  #1   
res.locals.infos = req.flash("info");    #1   

Earlier in the page, there is no declared variable that grabs the connect-flash module. On top of this, flash doesn't work without express-session and cookie-parser (both of which up to this point have received no explanation nor have they any presence in the code). This cause a bunch of errors when you run the app obviously (which on page 109 it suggests you do).

Pretty unfortunate, up to this point the book was pretty precise and easy to follow.
Evan Hahn (70) [Avatar] Offline
Chapter 8 has a lot of little errors like this that I'm currently fixing. Sorry about those!