Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 837 Bytes

File metadata and controls

23 lines (14 loc) · 837 Bytes

Chapter 4 Examples - Web Development with Node and Express, 2nd Edition

Using Node Modules

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.

Setup

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

Running

Minimal example; uses Express, but doesn't do very much. To run:

node 00-meadowlark

Then visit http://localhost:3000/about in your browser.