pm2 group console messages 1

pm2 group console messages

module.exports = {
  apps : [{
    name   : "app1",
    script : "./app.js",
    error_file : "./err.log",
    out_file : "./out.log"

Here is what the above code is Doing:
1. We are creating a JSON object with the name of the app, the script to run, and the log files.
2. We are exporting the JSON object.
3. We are saving the file as ecosystem.config.js.

Now, we can run the following command to start the app:

pm2 start ecosystem.config.js

Similar Posts