The method app.set(name, value) accepts two parameters: name and value. As you might guess, it sets the value for the name. For example, we often want to store the value of the port on which we plan to start our server:
Or, for a more advanced and realistic use case, we can grab the port from system environment variable PORT (process.env.PORT). If the PORT environment variable is undefined, we fall back to the hard-coded value 3000<...
- Chapter 3: Configuration, Settings, and Environments
- from Pro Express.js
- Publisher: Apress
- Released: December 2014
Share this highlighthttp://www.safaribooksonline.com/a/pro-expressjs/56010/