idbot / src /utils /databaseConnection.ts
ItsMa8di's picture
inital commit
a8ce9cb
Raw History Blame Contribute Delete
250 Bytes
import mongoose from "mongoose";
export const connectToDatabase = async (connectionString: string) => {
try {
await mongoose.connect(connectionString);
console.log("connected to the database");
} catch (e) {
console.error(e);
}
};