Eric Whale

Reset DB by connection issue

...@@ -73,7 +73,6 @@ const loginUser = asyncHandler(async (req, res) => { ...@@ -73,7 +73,6 @@ const loginUser = asyncHandler(async (req, res) => {
73 // @route GET /api/users/self 73 // @route GET /api/users/self
74 // @access Private 74 // @access Private
75 const getSelf = asyncHandler(async (req, res) => { 75 const getSelf = asyncHandler(async (req, res) => {
76 - // TODO
77 res.status(200).json(req.user); 76 res.status(200).json(req.user);
78 }); 77 });
79 78
......
1 { 1 {
2 "name": "client", 2 "name": "client",
3 "version": "0.1.0", 3 "version": "0.1.0",
4 + "proxy": "http://localhost:6000",
4 "private": true, 5 "private": true,
5 "dependencies": { 6 "dependencies": {
6 "@testing-library/jest-dom": "^5.16.4", 7 "@testing-library/jest-dom": "^5.16.4",
......
...@@ -6,6 +6,9 @@ const connectDB = async () => { ...@@ -6,6 +6,9 @@ const connectDB = async () => {
6 const conn = await mongoose.connect(process.env.MONGO_URI); 6 const conn = await mongoose.connect(process.env.MONGO_URI);
7 console.log(`MongoDB Connected: ${conn.connection.host}`.cyan.underline); 7 console.log(`MongoDB Connected: ${conn.connection.host}`.cyan.underline);
8 } catch (error) { 8 } catch (error) {
9 + console.log(
10 + `Error occured while connecting to the mongoDB`.magenta.underline
11 + );
9 console.log(error); 12 console.log(error);
10 process.exit(1); 13 process.exit(1);
11 } 14 }
......