Skip to content

Commit

Permalink
product search: adding a custom temporary api end point subscribe for…
Browse files Browse the repository at this point in the history
… gofetch landing page, will be removed after GO! Fetch b2c is online
  • Loading branch information
tareq89 committed Nov 1, 2016
1 parent 73f793c commit c8a0fcc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,20 @@ 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) {
assert.equal(null, err);
db.collection('subscribed').insert(email, function (err, result) {
assert.equal(null, err);
db.close();
res.json({ msg: "successfull" });
});
})
})
app.use('/api', router);

app.listen(port);
Expand Down

0 comments on commit c8a0fcc

Please sign in to comment.