Errata

Rapid Prototyping Web Applications Using Node.js and MongoDB

Errata for Rapid Prototyping Web Applications Using Node.js and MongoDB

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Other Digital Version 13:54
13mins 54 seconds

The example configure.js is missing an extra parenthesis on line 32 which will result in the following error:

/movieqslides/server/configure.js:34
routes.initialize(app, new express.Router());
^^^^^^
SyntaxError: Unexpected identifier
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/movieqslides/server.js:2:14)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)

Line should read:

app.use('/public/', express['static'](path.join(__dirname, '/public')))

Jon Hathaway  May 21, 2015 
Other Digital Version 48:44
48mins 44secs

In the controller.js, during the insert of the mongo document for a new user, on line 43 there is a technical error.

The line needs to be changed to the following so that the _id can be returned from the document insert.

req.session.userId = users._id;

Jon Hathaway  May 21, 2015