You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import mongoose from "mongoose";
|
|
|
|
const connectDB = async () => {
|
|
try {
|
|
await mongoose.connect(process.env.MONGO_URI)
|
|
console.log(`Sucessfully connected to mongoDB`)
|
|
} catch(error){
|
|
console.log(`ERROR: ${error.message}`)
|
|
process.exit(1)
|
|
}
|
|
}
|
|
|
|
export default connectDB |