Skip to content

Commit

Permalink
chore(heroku): support heroku mongodb url (snyk-labs#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal authored Feb 2, 2020
1 parent aab037b commit 9dabba3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 14 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
{
"name": "goof",
"scripts": {
},
"description": "A Snyk vulnerable Goof app on Heroku",
"repository": "https://github.com/snyk/goof",
"logo": "https://snyk.io/wp-content/uploads/title-card-avatar.png",
"keywords": [
"snyk",
"goof",
"heroku",
"node",
"security",
"vulnerabilities"
],
"image": "heroku/nodejs",
"scripts": {},
"env": {
"MONGOLAB_URI": {
"required": true
Expand All @@ -20,4 +31,4 @@
"url": "heroku/nodejs"
}
]
}
}
4 changes: 4 additions & 0 deletions db.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ if (mongoCFUri) {
} else if (process.env.MONGOLAB_URI) {
// Generic (plus Heroku) env var support
mongoUri = process.env.MONGOLAB_URI;
} else if (process.env.MONGODB_URI) {
// Generic (plus Heroku) env var support
mongoUri = process.env.MONGODB_URI;
}

console.log("Using Mongo URI " + mongoUri);

mongoose.connect(mongoUri);
Expand Down

0 comments on commit 9dabba3

Please sign in to comment.