diff --git a/TEST_SERVER1/api/app.js b/TEST_SERVER1/api/app.js index 1a9bb2e..bc23bce 100644 --- a/TEST_SERVER1/api/app.js +++ b/TEST_SERVER1/api/app.js @@ -29,7 +29,7 @@ app.post('/api/session', async function (req, res) { console.log('__dirname: ', path.join(__dirname, '..', app_name)) - console.log(app_name, whatsappId, client_url) + console.log('app_name: ', app_name, ' | whatsappId: ', whatsappId, ' | client_url: ',client_url) const sessionsPath = path.join(__dirname, '..', 'sessions') @@ -169,7 +169,7 @@ app.post('/api/session', async function (req, res) { db = db[0].db_conf } - if (dirSessionsNumberAppDirectories.length > 0) { + // if (dirSessionsNumberAppDirectories.length > 0) { if (db && Object.keys(db).length > 0) { @@ -228,7 +228,7 @@ app.post('/api/session', async function (req, res) { console.log('Number session: ', numberSession) - } + // } dirSessionAppName = `${whatsappId}_${number}_${numberSession}_${appPort}` @@ -436,6 +436,7 @@ process.on('uncaughtException', function (err) { console.error(' '); return }); + function deletePm2Process(process_name, currPath) { pm2.connect(function (err) { if (err) { diff --git a/TEST_SERVER1/whats/app.js b/TEST_SERVER1/whats/app.js index cb1bbdb..fa85f01 100644 --- a/TEST_SERVER1/whats/app.js +++ b/TEST_SERVER1/whats/app.js @@ -21,6 +21,10 @@ const FormData = require('form-data'); // const { MessageMedia } = require('./node_modules/whatsapp-web.js/src/structures'); let whatsappWebGlobalPath = path.join(process.env.NODE_PATH, 'whatsapp-web.js', '/src/structures'); whatsappWebGlobalPath = whatsappWebGlobalPath.replace(':','') + +console.log('whatsappWebGlobalPath: ', whatsappWebGlobalPath) +console.log('process.env.NODE_PATH: ', process.env.NODE_PATH) + const { MessageMedia } = require(whatsappWebGlobalPath); const logger = require('logger')