Make connection to db non-async
This commit is contained in:
@ -11,7 +11,7 @@ if (!url) {
|
|||||||
throw new Error('MONGODB_URI is not defined in the .env file.');
|
throw new Error('MONGODB_URI is not defined in the .env file.');
|
||||||
}
|
}
|
||||||
|
|
||||||
const dbconnect = async () =>{
|
const dbconnect = () => {
|
||||||
mongoose.connect(url)
|
mongoose.connect(url)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('Connected to MongoDB');
|
console.log('Connected to MongoDB');
|
||||||
|
Reference in New Issue
Block a user