ludo web based game config file changes

This commit is contained in:
2026-01-28 14:02:27 +05:30
parent 4cd0fe970f
commit 5b02a13cb4
8 changed files with 745 additions and 39 deletions
+8 -12
View File
@@ -1,13 +1,9 @@
module.exports = function (mongoose) {
mongoose.set('useFindAndModify', false);
mongoose
.connect(process.env.CONNECTION_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
dbName: 'test',
})
.then(() => {
console.log('MongoDB Connected…');
})
.catch(err => console.error(err));
module.exports = async function (mongoose) {
try {
await mongoose.connect(process.env.CONNECTION_URI);
console.log('✅ MongoDB connected');
} catch (err) {
console.error('❌ MongoDB connection error:', err);
process.exit(1);
}
};