Skip to content

Commit 0b3f653

Browse files
committed
ui issues fixed
## Related Issue [Cite any related issue(s) this pull request addresses. If none, simply state "None”] ## Description [Please include a brief description of the changes or features added] ## Type of PR - [ ] Bug fix - [ ] Feature enhancement - [ ] Documentation update - [ ] Other (specify): _______________ ## Screenshots / videos (if applicable) [Attach any relevant screenshots or videos demonstrating the changes] ## Checklist: - [ ] I have performed a self-review of my code - [ ] I have read and followed the Contribution Guidelines. - [ ] I have tested the changes thoroughly before submitting this pull request. - [ ] I have provided relevant issue numbers, screenshots, and videos after making the changes. - [ ] I have commented my code, particularly in hard-to-understand areas. <!-- [X] - put a cross/X inside [] to check the box --> ## Additional context: [Include any additional information or context that might be helpful for reviewers.]
1 parent 715d3de commit 0b3f653

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

server/config/database.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
const mongoose = require('mongoose')
1+
const mongoose = require('mongoose');
22

33
const databaseConnection = () => {
4-
mongoose.connect(process.env.DB,{
4+
mongoose.connect(process.env.DB, {
55
useNewUrlParser: true,
66
useUnifiedTopology: true
7-
}).then((data)=>{
8-
console.log(`database connected successfully at server ${data.connection.host}`)
97
})
10-
}
8+
.then((data) => {
9+
console.log(`Database connected successfully at host: ${data.connection.host}`);
10+
})
11+
.catch((err) => {
12+
console.error(`Failed to connect to the database. Error: ${err.message}`);
13+
process.exit(1); // Exit the process with failure
14+
});
15+
};
1116

12-
module.exports = databaseConnection
17+
module.exports = databaseConnection;

server/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const app = require('./app')
22
const databaseConnection = require('./config/database')
33
const cloudinary = require('cloudinary')
44
const dotenv = require('dotenv')
5-
dotenv.config({path:"./config/config.env"})
5+
dotenv.config({path:"./config/.env"})
66

77

88
cloudinary.config({

0 commit comments

Comments
 (0)