Created
June 13, 2020 22:37
-
-
Save ahmad-ali14/9ffd17b5904aa64481521f3d0ff194ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//DB and authentication | |
mongo.connect(process.env.DATABASE, (err, cluster) => { | |
if(err) { | |
console.log('Database error: ' + err); | |
} else { | |
//connecting to the cluster | |
console.log('Successful database connection'); | |
//connetcing to the database | |
const db = cluster.db(DATABASE_NAME); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment