Advertisement
Guest User

Untitled

a guest
Nov 20th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. app.get('/payments', function(req, res) {
  2. res.header("Access-Control-Allow-Origin", "*");
  3. res.header("Access-Control-Allow-Headers", "X-Requested-With");
  4. res.connection.setTimeout(0); // this could take a while
  5.  
  6. res.writeHead(200, {
  7. 'Content-Type': 'text/event-stream',
  8. 'Connection': 'keep-alive',
  9. 'Cache-Control': 'no-cache',
  10. });
  11. ee.on("payment"+req.query.wallet, function (datoak) {
  12. res.write("data: "
  13. + JSON.stringify({'wallet': datoak.address, 'refund_address': datoak.refund_address,'payment_status': 'paid'})
  14. + "nn")
  15. });
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement