function handleHttpGet(query, callback) {
  // Verify with our custom defined VERIFY_TOKEN
  if (query['hub.mode'] === 'subscribe' && query['hub.verify_token'] === PAGE_VERIFY_TOKEN) {
    let challenge = query['hub.challenge']

    let response = {
      body: parseInt(challenge),
      statusCode: 200
    }
    callback(null, response)
  } else {
    let response = {
      body: 'Error, wrong validation token',
      statusCode: 422
    }
    callback(response)
  }
}
/**
 * This function handles webhook http GET event usually called from Facebook App WebHook Subscription.
 * @param {object} query 
 * @param {function} callback 
 */
This function handles webhook http GET event usually called from Facebook App WebHook Subscription.
@param {object} query
@param {function} callback
This function handles webhook http GET event usually called from Facebook App WebHook Subscription . @param { object } query @param { function } callback
function handleHttpGet(query, callback) {
  if (query['hub.mode'] === 'subscribe' && query['hub.verify_token'] === PAGE_VERIFY_TOKEN) {
    let challenge = query['hub.challenge']
    let response = {
      body: parseInt(challenge),
      statusCode: 200
    }
    callback(null, response)
  } else {
    let response = {
      body: 'Error, wrong validation token',
      statusCode: 422
    }
    callback(response)
  }
}
function handleHttpGet ( query , callback ) { if ( query [ 'hub.mode' ] === 'subscribe' && query [ 'hub.verify_token' ] === PAGE_VERIFY_TOKEN ) { let challenge = query [ 'hub.challenge' ] let response = { body : parseInt ( challenge ) , statusCode : 200 } callback ( null , response ) } else { let response = { body : 'Error, wrong validation token' , statusCode : 422 } callback ( response ) } }
This function handles webhook http GET event usually called from Facebook App WebHook Subscription.
This function handles webhook http GET event usually called from Facebook App WebHook Subscription .
// Verify with our custom defined VERIFY_TOKEN