Skip to content

Commit

Permalink
added image in title
Browse files Browse the repository at this point in the history
  • Loading branch information
MadalapureVaishnavi committed Jun 24, 2024
1 parent 7492503 commit 9c54ec4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
13 changes: 12 additions & 1 deletion client/dist/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion client/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 14 additions & 4 deletions server/dbConfig/dbConnection.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import mongoose from "mongoose";
import dotenv from "dotenv";

dotenv.config(); // Load environment variables from .env file

const dbConnection = async () => {
try {
const dbConnection = await mongoose.connect(process.env.MONGODB_URL);
console.log("Database connected successfully");
const dbUri = process.env.MONGO_URL;
if (!dbUri) {
throw new Error("MONGO_URL environment variable is not set.");
}

await mongoose.connect(dbUri, {
useNewUrlParser: true,
useUnifiedTopology: true,
});

console.log("Database connected successfully");
} catch (error) {
console.log('MongoConnection Failed !!' + error );
console.log('MongoConnection Failed !! ' + error);
}
}

export default dbConnection;
export default dbConnection;
2 changes: 1 addition & 1 deletion server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"bcryptjs": "^2.4.3",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"dotenv": "^16.4.1",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"express-async-errors": "^3.1.1",
"express-mongo-sanitize": "^2.2.0",
Expand Down

0 comments on commit 9c54ec4

Please sign in to comment.