import { fileURLToPath } from 'url'; import { join } from 'path'; import { readFileSync } from 'fs'; const __filename = fileURLToPath(import.meta.url); const __dirname = new URL('.', import.meta.url).pathname; const configPath = join(__dirname, '../../config.json'); let config; try { const configContent = readFileSync(configPath, 'utf-8'); config = JSON.parse(configContent); } catch (error) { throw new Error(`Failed to load config.json from ${configPath}: ${error.message}`); } export default config;