pm2 start app.js?When you use PM2 to start an Express app with pm2 start app.js, what is the main behavior PM2 provides?
Think about what process managers do to keep apps running smoothly.
PM2 runs your app and watches it. If the app crashes or stops, PM2 restarts it automatically to keep it running.
pm2 list after starting two apps?You started two Express apps with PM2: pm2 start app1.js and pm2 start app2.js. What will pm2 list show?
PM2 keeps track of all running apps and shows their status.
The pm2 list command displays all apps PM2 manages, showing their names, IDs, and if they are online.
server?Choose the correct PM2 command to restart an app named server.
Look for the PM2 command that explicitly restarts an app by name.
pm2 restart server is the correct syntax to restart an app named server. Other options are invalid or do different things.
pm2 logs show no output after starting an app?You started your Express app with PM2 using pm2 start app.js, but pm2 logs shows no output even when you make requests. What is a likely cause?
Think about what your app prints to the console and what PM2 captures.
If the app does not use console.log or similar, PM2 logs will be empty because there is no output to capture.
pm2 save and then reboot the server?After starting your Express app with PM2, you run pm2 save and then reboot your server. What is the expected behavior after reboot?
Consider what pm2 save does and how PM2 integrates with system startup.
pm2 save saves the current process list. If PM2 startup scripts are configured, it will auto-restart saved apps on reboot.