Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added image in title #297

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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