Dennis Dennis - 1 year ago 210
Node.js Question

How to change value of process.env.PORT in node.js?

I'd like to change the value of

, how can I do this?

I'm running Ubuntu 12.04.

Answer Source

For just one run (from the unix shell prompt):

$ PORT=1234 node app.js

More permanently:

$ export PORT=1234
$ node app.js

In Windows:

set PORT=1234

In Windows PowerShell:

$env:PORT = 1234
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download