I have server.js and db.js The db.js file interacts with my database using Mongoose and I use server.js to call functions         
        
You can read about the error online but the solution for this problem is: go to you MongoDB atlas and add your IP address.
Go to: main page > security section > network access > add IP
This problem is basically when the architecture do not know your own IP address.
Also, copy-paste directly to google to get straight forward solution.