Skip to content

Commit

Permalink
database link try 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mbadr2200 committed Mar 23, 2018
1 parent 18880de commit 32f3248
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion server/config/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// env variables
var env = process.env.NODE_ENV || 'development';

console.log(env);

if(env === 'development')
{
Expand All @@ -10,4 +10,7 @@ if(env === 'development')
{
process.env.PORT = 3000;
process.env.MONGODB_URI = 'mongodb://localhost:27017/TodoAppTest';
}else if (env === 'production')
{
process.env.MONGODB_URI = "mongodb://admin123@ds119049.mlab.com:19049/todo-app";
}
2 changes: 1 addition & 1 deletion server/db/mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var mongoose = require('mongoose');

mongoose.promise = global.promise;
// mongoose.connect('mongodb://admin:123321@ds115579.mlab.com:15579/orders');
mongoose.connect(process.env.MONGODB_URI || "mongodb://admin123@ds119049.mlab.com:19049/todo-app");
mongoose.connect(process.env.MONGODB_URI);


module.exports.mongoose = mongoose ;

0 comments on commit 32f3248

Please sign in to comment.