-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Pranavtej/vamsi
ECARD-3
- Loading branch information
Showing
3 changed files
with
22 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
// const mongoose = require('mongoose'); | ||
// const dotenv = require('dotenv'); | ||
const mongoose = require('mongoose'); | ||
const dotenv = require('dotenv'); | ||
|
||
// // Load the environment variables from .env file | ||
// dotenv.config(); | ||
// Load the environment variables from .env file | ||
dotenv.config(); | ||
|
||
// // MongoDB connection URL | ||
// const mongoUrl = `mongodb://${process.env.DB_HOST}:${process.env.DB_PORT}/${process.env.DB_DATABASE}`; | ||
// MongoDB connection URL | ||
const mongoUrl = `mongodb+srv://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}/${process.env.DB_DATABASE}?retryWrites=true&w=majority`; | ||
|
||
// // Set up MongoDB connection | ||
// mongoose.connect(mongoUrl, { | ||
// useNewUrlParser: true, | ||
// useUnifiedTopology: true, | ||
// useCreateIndex: true, | ||
// }); | ||
// Set up MongoDB connection | ||
mongoose.connect(mongoUrl, { | ||
useNewUrlParser: true, | ||
useUnifiedTopology: true, | ||
}); | ||
|
||
// const db = mongoose.connection; | ||
const db = mongoose.connection; | ||
|
||
// db.on('error', (error) => { | ||
// console.error('MongoDB connection error:', error); | ||
// process.exit(1); // Exit process on connection error | ||
// }); | ||
db.on('error', (error) => { | ||
console.error('MongoDB connection error:', error); | ||
process.exit(1); // Exit process on connection error | ||
}); | ||
|
||
// db.once('open', () => { | ||
// console.log('Connected to MongoDB'); | ||
// }); | ||
db.once('open', () => { | ||
console.log('Connected to MongoDB'); | ||
}); | ||
|
||
// module.exports = mongoose; | ||
module.exports = mongoose; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,6 @@ | |
<title>eCardify</title> | ||
</head> | ||
<body> | ||
<h1>eCardify</h1> | ||
<h1>Welcome eCardify </h1> | ||
</body> | ||
</html> |