Guest User

Untitled

a guest
Dec 28th, 2016
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.get('/webhook', function(req, res) {
  2.   if (req.query['hub.mode'] === 'subscribe' &&
  3.       req.query['hub.verify_token'] === thisTokenIsShit1233) {
  4.     console.log("Validating webhook");
  5.     res.status(200).send(req.query['hub.challenge']);
  6.   } else {
  7.     console.error("Failed validation. Make sure the validation tokens match.");
  8.     res.sendStatus(403);
  9.   }
  10. });
Advertisement
Add Comment
Please, Sign In to add comment