Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (app.get("env") === "development") {
}

// connect to database
app.db = mongoose.connect(process.env.MONGOLAB_URI);
app.db = mongoose.connect(process.env.MONGODB_URI);

// view engine setup - this app uses Hogan-Express
// https://github.com/vol4ok/hogan-express
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ If you log-in to your heroku dashboard at <https://heroku.com>, you'll now see t

10) Get the Heroku MongoLab connection string into an .env file.

heroku config --shell | grep MONGOLAB_URI >> .env
heroku config --shell | grep MONGODB_URI >> .env

Your connection string to MongoDB will now be in a **.env** file now (go have a look at the .env file). Your app connects to this database in the app.js file:

app.db = mongoose.connect(process.env.MONGOLAB_URI);
app.db = mongoose.connect(process.env.MONGODB_URI);

Your **.env file** is a secret config file that holds key app variables like this MongoDB URI string, and other things like 3rd Party API secrets and keys. It is specified in the .gitignore file, which means the .env file will **not** be tracked by .git and not available for others to see on github (this is good).

Expand Down