My MongoDB server just wont connect to my API even though its accessible by all IPs.
its running perfectly on both Heroku and and my local system.
I am unable to diagnose it properly I am new to web-development and this is the first time I encountered this issue. but I am pretty sure it has something to do with error while connecting with mongoDB
pasting the screenshots explaining why i am suspecting this
i created a flag to check if connection with server is successful
Then i sent different responses on home route depending on flag (" / ")
And then the response i get on home route is that db is not connected-
Can someone please help i need this urgently my project deadline is coming up soon