Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Able to insert new author even though have not setup mongodb atlas #95

Closed
000orion000 opened this issue Sep 29, 2020 · 1 comment
Closed

Comments

@000orion000
Copy link

Hi,

I have clone it and running it in Digital Ocean.
I am a bit puzzled that I am able to insert new authors despite
not setting up the connection to atlas.

The code I am referring to is in app.js -
var dev_db_url = 'mongodb+srv://cooluser:coolpassword@cluster0-mbdj7.mongodb.net/local_library?retryWrites=true'

Thanks in advance...

@hamishwillee
Copy link
Collaborator

hamishwillee commented Sep 30, 2020

See the following lines:

var dev_db_url = 'mongodb+srv://cooluser:coolpassword@cluster0-mbdj7.mongodb.net/local_library?retryWrites=true'
var mongoDB = process.env.MONGODB_URI || dev_db_url;
mongoose.connect(mongoDB, { useNewUrlParser: true });

Mongoose connects through to that database by default using the specified URL. It is a "real" URL that I setup.

Hope that answers your question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants