created bacis structure and routes for creating user and logging in

This commit is contained in:
QkoSad
2022-12-05 14:25:27 +02:00
commit 8fd0b86492
10 changed files with 4616 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
const mongoose = require("mongoose");
const connectDB = async () => {
try {
const conn = await mongoose.connect(process.env.MONGO_URI);
console.log(`MongoDB Connected:${conn.connection.host}`.cyan.underline);
} catch (error) {
console.log(`Error:${error.message}`.red.underline.bold);
process.exit(1);
}
};
module.exports = connectDB;