Skip to content

Commit b3d998a

Browse files
committed
db: db
added mongodb functionality
1 parent 77ebd9a commit b3d998a

File tree

4 files changed

+2109
-0
lines changed

4 files changed

+2109
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

db/db.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import mongoose from "mongoose";
2+
3+
export function dbConnection() {
4+
mongoose
5+
.connect(`mongodb://localhost:27017`)
6+
.then(() => {
7+
console.log("DB Connected Succesfully");
8+
})
9+
.catch((error) => {
10+
console.log("DB Failed to connect", error);
11+
});
12+
}

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "ecartbackend",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"type": "module",
7+
"scripts": {
8+
"start": "nodemon index.js",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"engines": {
12+
"node": "18.12.0"
13+
},
14+
"keywords": [],
15+
"author": "",
16+
"license": "ISC",
17+
"dependencies": {
18+
"bcrypt": "^5.1.1",
19+
"cors": "^2.8.5",
20+
"dotenv": "^16.3.1",
21+
"express": "^4.18.2",
22+
"joi": "^17.9.2",
23+
"jsonwebtoken": "^9.0.2",
24+
"mongoose": "^7.4.4",
25+
"morgan": "^1.10.0",
26+
"multer": "^1.4.5-lts.1",
27+
"nodemon": "^3.0.2",
28+
"qrcode": "^1.5.3",
29+
"slugify": "^1.6.6",
30+
"stripe": "^13.9.0",
31+
"uuid": "^9.0.1"
32+
}
33+
}

0 commit comments

Comments
 (0)