How to change value of process.env.PORT in node.js?
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
use the below command to set the port number in node process while running node JS programme:
set PORT =3000 && node file_name.js
The set port can be accessed in the code as
process.env.PORT