added message if database connection is not working

This commit is contained in:
Jack 2021-11-23 21:53:41 +00:00
parent 9671c8115d
commit ecc91f8fc4

View file

@ -17,6 +17,7 @@ module.exports = {
});
},
mongoDB() {
if (!mongoClient) throw new Error("Database is offline");
return mongoClient.db(process.env.DB_NAME);
},
};