pm2
npm install pm2 -g
0
9
$ pm2 restart app_name
$ pm2 reload app_name
$ pm2 stop app_name
$ pm2 delete app_name
Thank you!
9
0
3.67
3
# Monitoring CPU/Memory
pm2 monit
pm2 monitor
Make pm2 auto-boot at server restart:
pm2 startup
# Go To Server Directory Where you have store Express Files
pm2 start app.js -o "/dev/null" -e "/dev/null"
# Freeze your process list across server restart
3.pm2 save
# Auto restart apps on file change
4. pm2 start app.js --watch
# Remove init script via:
$ pm2 unstartup systemd
Thank you!
3
0
3.71
7
module.exports = {
apps : [{
name: "app",
script: "./app.js",
env: {
NODE_ENV: "development",
},
env_production: {
NODE_ENV: "production",
}
}, {
name: 'worker',
script: 'worker.js'
}]
}
Thank you!
7
0
0
9
$ npm install pm2@latest -g
# or
$ yarn global add pm2
Thank you!
9
0
4.25
4
$ pm2 [list|ls|status]
Thank you!
4
0
Are there any code examples left?
New code examples in category Javascript