0

I have a production code that uses restify for REST Api. However, I want hot code pushes in a particular scenario. The Admin Panel.

Our client app is mobile only. Whenever a transaction is initiated a MongoDB document is created. I want it to live update on the Admin Panel, which is simple HTML page.

I was considering Meteor for this. Is it possible? If not, what are the alternatives?

Thanks.

Transaction save to db code:

function onTransactionStart(req, res, next){
  var transaction = {};
  var quantity = {};
  var obj=req.body;
  generateToken(8);
  transaction._id = token;
  transaction.u_id = obj.u_id;
  transaction.emp_id = obj.emp_id;
  transaction.lat = obj.lat;
  transaction.lon = obj.lon;
  transaction.quantity = quantity;
  transaction.quantity.paper = obj.paper;
  transaction.quantity.plastic = obj.plastic;
  transaction.mode = obj.mode;
  transaction.date = new Date();
  transaction.status = obj.status;
  transactions.save(transaction , function(err , success){
      console.log('Response success '+success);
      console.log('Response error '+err);
      if(success){
          res.send(201 , transaction);
          return next();
      }else{
          return next(err);
      }
  });
}
Abhishek Dey
  • 1,601
  • 1
  • 15
  • 38

0 Answers0