Skip to content

Commit

Permalink
set app to use mongodb rui from environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
GoZaddy committed Jun 21, 2020
1 parent 0c82f42 commit fbccaa4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ app.use(cors())

//connect to mongoDB Atlas
//TODO: put mongodb URI in .env file


mongoose.connect(
"mongodb+srv://GoZaddy:[email protected]/iChop?retryWrites=true&w=majority",
process.env.MONGODB_URI || "mongodb+srv://GoZaddy:[email protected]/iChop?retryWrites=true&w=majority",
{ useNewUrlParser: true, useUnifiedTopology: true }
);
const db = mongoose.connection;
Expand Down

0 comments on commit fbccaa4

Please sign in to comment.