From 47a216f22431092d5b96af172f4a3df3175edda6 Mon Sep 17 00:00:00 2001 From: Manogna Date: Wed, 11 Dec 2024 15:56:46 -0800 Subject: [PATCH] feat: Restructure project --- server/api/config/db.js | 16 ---------------- .../User.js => middleware/authMiddleware.js} | 0 server/models/User.js | 0 server/{api => }/services/aiService.js | 0 4 files changed, 16 deletions(-) delete mode 100644 server/api/config/db.js rename server/{api/models/User.js => middleware/authMiddleware.js} (100%) create mode 100644 server/models/User.js rename server/{api => }/services/aiService.js (100%) diff --git a/server/api/config/db.js b/server/api/config/db.js deleted file mode 100644 index 49518ef..0000000 --- a/server/api/config/db.js +++ /dev/null @@ -1,16 +0,0 @@ -const mongoose = require("mongoose"); - -const connectDB = async () => { - try { - await mongoose.connect(process.env.DATABASE_URI, { - useNewUrlParser: true, - useUnifiedTopology: true, - }); - console.log("MongoDB Connected..."); - } catch (error) { - console.error("Database connection error:", error); - process.exit(1); - } -}; - -module.exports = connectDB; diff --git a/server/api/models/User.js b/server/middleware/authMiddleware.js similarity index 100% rename from server/api/models/User.js rename to server/middleware/authMiddleware.js diff --git a/server/models/User.js b/server/models/User.js new file mode 100644 index 0000000..e69de29 diff --git a/server/api/services/aiService.js b/server/services/aiService.js similarity index 100% rename from server/api/services/aiService.js rename to server/services/aiService.js