This commit is contained in:
Mr Swift
2024-04-27 20:10:55 +03:30
parent f52f5496c5
commit ee6bd01224
30 changed files with 6503 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
const mongoose = require("mongoose");
const db = async () => {
try {
const connect = await mongoose.connect(process.env.CONNECTION_STRING);
console.log(
"Database connected: ",
connect.connection.host,
connect.connection.name
);
} catch (err) {
console.log(err);
setTimeout(() => {
console.log("Retry for DB");
db();
}, 5000);
}
};
module.exports = db;