initial commit
This commit is contained in:
12
server/ConnectionDb.js
Normal file
12
server/ConnectionDb.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const mongoose = require("mongoose");
|
||||
require("dotenv").config();
|
||||
exports.connectdb = () => {
|
||||
mongoose.connect(process.env.mongoURI);
|
||||
};
|
||||
|
||||
const db = mongoose.connection;
|
||||
|
||||
db.on("error", console.error.bind("Connection Error!"));
|
||||
db.once("open", function () {
|
||||
console.log("Connection Established!!!");
|
||||
});
|
||||
Reference in New Issue
Block a user