Initial commit

This commit is contained in:
2026-09-16 17:36:46 +05:30
commit c9f429d123
117 changed files with 14145 additions and 0 deletions

15
server/config/db.js Normal file
View File

@@ -0,0 +1,15 @@
const mongoose = require('mongoose');
const connectDB = async () => {
try {
const conn = await mongoose.connect(process.env.MONGODB_URI || 'mongodb://127.0.0.1:27017/guitar_ecommerce');
console.log(`[MongoDB Connected]: ${conn.connection.host}`);
} catch (error) {
console.error(`[MongoDB Connection Error]: ${error.message}`);
// Process can continue for seed script or fallback handling
process.exit(1);
}
};
module.exports = connectDB;