Skip to content

Commit

Permalink
changed subscription db url
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq89 committed Feb 7, 2017
1 parent 3185c4c commit 5da169d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ var bodyParser = require('body-parser');
var assert = require('assert');
var MongoClient = require('mongodb').MongoClient;
var url = 'mongodb://gobd:[email protected]:27017/taskcat';
var SubscriptionDBurl = 'mongodb://gobd:[email protected]:27017/taskcatdev';

var productDbUrl = 'mongodb://gofetch.cloudapp.net:27017/test';

var port = process.env.PORT || 8000;
Expand Down Expand Up @@ -254,9 +256,9 @@ router.get('/store', function (req, res) {
router.post('/subscribe', function (req, res) {
console.log(req.body);
var email = req.body;
MongoClient.connect(productDbUrl, function (err, db) {
MongoClient.connect(SubscriptionDBurl, function (err, db) {
assert.equal(null, err);
db.collection('subscribed').insert(email, function (err, result) {
db.collection('Subscription').insert(email, function (err, result) {
assert.equal(null, err);
db.close();
res.json({ msg: "successfull" });
Expand Down

0 comments on commit 5da169d

Please sign in to comment.