pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

pm2.connnect and pm2.start

Open xeoshow opened this issue 2 years ago • 0 comments

Hello,

Does your pm2 support the config file as input paramter? Something like this: "pm2.start(configFile...", thanks a lot.

    pm2.connect((err) => {
      if (err) {
        console.error('Error connecting to PM2:', err);
        return reject(err);
      }

      pm2.start(configFile, (error, apps) => {
        pm2.disconnect(); // Disconnects from PM2
        if (error) {
          console.error('Error starting app:', error);
          return reject(error);
        }

        return resolve(apps);
      });
      return null;
    });

xeoshow avatar Feb 13 '24 14:02 xeoshow