This chapter is mostly background information, so there's only one example in this chapter; taking the "fortunte cookie" functionality that was developed in Chapter 3, and placing it in a Node module. See lib/fortune.js and meadowlark.js.
The example in this chapter has Node module dependencies (express
and express-handlebars
). These dependencies are listed in the package.json file. However, when you first clone this repo, you won't have them installed (package.json is simply a manifest). To install them, simply run:
npm install
Minimal example; uses Express, but doesn't do very much. To run:
node 00-meadowlark
Then visit http://localhost:3000/about in your browser.