Test the handlers around process.on('SIGTERM')
for pm2 restart|stop|kill
.
Run the following commands in separate shells:
- pm2 start index.json
- while true; do (curl localhost:5001 -m 7 2>/dev/null &) ; sleep 10; done
And trigger conditions with pm2 restart|stop|kill