// chat_v2: wrapper that starts the main chat/server.js file
// using robust path detection for both container (/opt/webchat) and local environments
const fs = require('fs');
const path = require('path');

// Container path: /opt/webchat/server.js
// Local path: ../chat/server.js
const containerPath = '/opt/webchat/server.js';
const localPath = path.join(__dirname, '../chat/server.js');

if (fs.existsSync(containerPath)) {
  require(containerPath);
} else {
  require(localPath);
}
