-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28e431d
commit 2a1c079
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters