Deploy: 2026-05-21 17:59:48
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
"@whiskeysockets/baileys": "^6.7.9",
|
||||
"axios": "^1.7.2",
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^16.4.5",
|
||||
"express": "^4.19.2",
|
||||
"pino": "^9.2.0"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const dotenv = require('dotenv');
|
||||
|
||||
// Find .env file identically to how PHP bootstrap does it
|
||||
const envPaths = [
|
||||
path.join(__dirname, '.env'),
|
||||
path.join(__dirname, '../.env'),
|
||||
path.join(__dirname, '../backend/.env'),
|
||||
path.join(__dirname, '../../../.env')
|
||||
];
|
||||
|
||||
for (const p of envPaths) {
|
||||
if (fs.existsSync(p)) {
|
||||
dotenv.config({ path: p });
|
||||
console.log(`Loaded environment from ${p}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const express = require('express');
|
||||
const cors = require('cors');
|
||||
const { startSession, disconnectSession } = require('./baileys-client');
|
||||
|
||||
Reference in New Issue
Block a user