How can I start a Node.js app with forever on a port that I set on the command-line?
forever, node.js
Solution
You're setting a shell variable, not an environment variable. Yes, the distinction is confusing.
Try putting `export` at the beginning of that line.
Problem
I am trying to use this command which should work. It does not seem to pass along the environment variable when starts the server which uses Express.js. This is for this Open Source project, Bus Ticker. `PORT=8081; forever start ./website/app.js` In `app.js` is has this line so I am expect that I can set the environment variable on that command-line as shown above. `app.set('port', process.env.PORT || process.env.npm_package_config_port || 3000);`