process.env.DEBUG = 'mongodb:*';

const mongodb = require('mongodb');

const uri = 'mongodb://admin:adminpassword@192.168.0.197:27017/ludo?authSource=admin';
console.log('Connecting to:', uri);

const client = new mongodb.MongoClient(uri, {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    authSource: 'admin',
    serverSelectionTimeoutMS: 3000,
    loggerLevel: 'debug',
});

client.connect((err) => {
    if (err) {
        console.error('❌ Connection error:', err);
    } else {
        console.log('✅ Connected!');
        client.close();
    }
});
