Hello,
I’ve been researching for days every possible solution but I still get the same error when trying to connect to my MongoDB database using axios.get("http://localhost:4000/api/v1/quality");
in my front-end reactjs app. I get the following error in console. I tried every possible port but I get this error every time:
I started the MongoDB server with brew services start mongodb-community@7.0
. Status started
. No issues there, tho during installation I had to create a new folder on the desktop to store the db., and I changed the dbPath in the mongod.conf
file.
The MongoDB Compass app is running and a connection is created on mongodb://localhost:27017
. When I access this link in Chrome, it outputs It looks like you are trying to access MongoDB over HTTP on the native driver port.
I tried re-installing everything: MongoDB, my app, the db, etc. Can someone help me fix this ERR_CONNECTION_REFUSED
error and fetch my data from the db?