Reputation:
I have a process running in PORT 3000 and I want to deploy this process in any other PORT. How can I do this?
Upvotes: 1
Views: 6210
Reputation: 660
PM2 does not decide your port, it's however the app PM2 is managing binds to the port is what you need to change.
Upvotes: 1
Reputation: 8081
This is a simple configuration for pm2:
module.exports = {
apps : [
{
name: "myapp",
script: "./app.js",
watch: true,
instance_var: 'INSTANCE_ID',
env: {
"PORT": 3000,
"NODE_ENV": "development"
}
}
]
}
There is an apps.env.PORT
key you can use.
Upvotes: 3