1611 shaares
17 private links
17 private links
2 results
tagged
pm2
It is now available with the latest PM2 version:
{
apps : [{
name : 'API',
script : 'api.js',
interpreter : 'node@6.9.1'
}]
}
https://github.com/Unitech/pm2/blob/master/test/fixtures/nvm-node-version/ecosystem.json#L12
You can use environment variable.
For example:
1) NODE_PORT=3002 pm2 start -I 0 app.js
2) Read value in app:
console.log(process.env.NODE_PORT);
Or, if you are build express app:
1) PORT=3002 pm2 start -I 0 ./bin/www
2) Express load PORT automatically at start application.