From b0eabd229e1a77a98040ec4214606723ee0a84b6 Mon Sep 17 00:00:00 2001 From: SongHia Date: Tue, 12 Apr 2016 23:06:59 -0400 Subject: [PATCH] updated config variable from MONGOLAB_URI to MONGODB_URI per update April 12, 2016 https://devcenter.heroku.com/articles/mongolab --- app.js | 2 +- readme.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 2d37426..de1a579 100644 --- a/app.js +++ b/app.js @@ -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 diff --git a/readme.md b/readme.md index 3ca84f7..5757067 100644 --- a/readme.md +++ b/readme.md @@ -59,11 +59,11 @@ If you log-in to your heroku dashboard at , 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).