Node.js is on the server.

I"d like to ask that the node.js service can be stopped locally through npm start startup, Ctrl + C.

how to start and stop on the server

after using pm2 start. / bin/www, this server will never stop, and that server can be accessed all the time.

ask for the correct posture

Mar.02,2021

https://codeshelper.com/a/11.

$ npm install pm2 -g     -sharp  pm2 
$ pm2 start app.js -i 4  -sharp pm24app.js 
                         -sharp 'max'  start
                         -sharp Cpu
$ pm2 start app.js --name my-api -sharp 
$ pm2 list               -sharp 
$ pm2 monit              -sharp 
$ pm2 logs               -sharp 
$ pm2 stop all           -sharp 
$ pm2 restart all        -sharp 
$ pm2 reload all         -sharp 0  ( NETWORKED )
$ pm2 stop 0             -sharp 
$ pm2 restart 0          -sharp 
$ pm2 startup            -sharp  init  
$ pm2 web                -sharp  computer API endpoint (http://localhost:9615)
$ pm2 delete 0           -sharp 
$ pm2 delete all         -sharp 

pm2 list

View the service you started

pm2 stop id/name

stop the service

Menu