Deploying very first hook.io service

10 views
Skip to first unread message

arpit shah

unread,
Oct 19, 2016, 1:36:41 AM10/19/16
to Hook.io
Hello,

I am writing very first hook.io deployment.
I have the following code for the main entry point to the server.

module['exports'] = function handleMessage (hook) {
  

   if (hook.req.method === 'GET') {
     if (hook.params['hub.verify_token'] === 'verifycode') {
        hook.res.end(hook.params['hub.challenge']);
     }
   }
   
  else if (hook.req.method === 'POST') {
   }

};

- Here, problem is that Even if I call http GET method, it is always treated as "POST" . if  block for GET is never executed.
  IT would be great if you can try to help what's wrong is happening here

    

Thx,
Arpit
Reply all
Reply to author
Forward
0 new messages