diff --git a/backend/app.js b/backend/app.js index ec954eb..2592846 100644 --- a/backend/app.js +++ b/backend/app.js @@ -13,8 +13,8 @@ const CoinGecko = require('coingecko-api'); //const RequestIP = require('@supercharge/request-ip'); var db = require('./config/db'); -mongoose.connect(db.url).then(() => { - console.log("connecting-- ", db); +mongoose.connect('mongodb://'+db.user+':'+db.password+'@'+db.server+'/'+db.database).then(() => { + console.log("connecting-- ", db.database); }).catch(() => { console.log("connection failed!"); }); @@ -128,6 +128,8 @@ var blockInterval = setInterval( function() { console.log(err); } console.log('Owner saved!'); + }).catch(() => { + console.log('Owner exists'); }); } }).catch((err) => { diff --git a/backend/config/db.js b/backend/config/db.js index 48c8b16..b9f4a66 100644 --- a/backend/config/db.js +++ b/backend/config/db.js @@ -1,3 +1,6 @@ module.exports = { - url : 'mongodb://localhost:27017/test' + server : 'localhost:27017', + user: 'zgo', + password: 'zcashrules', + database: 'zgo' }