Challange 1 Solution

In notebook:
FrontEndMasters Building Web Apps with Node.js
Created at:
2015-10-08
Updated:
2015-10-08
Tags:
bugfix backend Node JS JavaScript
Video Course on Building Web Applications with Node.jsSometimes node (npm) can install to a parent directory node_modules folder if it finds one. Not where you expect it.​fs.readFile​ actually buffers to whole file into memory before invoking your callback
it's also possible to stream a file as being read (doesn't say which module)
recommend a package to interact with REST services: 'request'
also 'XMLHttpRequest' - more lightweight -it's cross platform, works on client and server (with browserify) 
use underscore to extend the object​module.exports = Person​ 
if your object has just one object (like a person or an order) you can use this pattern

or

you can use

​exports.Logger = Logger

then in app.js

var logger = new logger.Logger;

​the ​exports​ object is what is returned by ​require​