简体   繁体   中英

Webhook deployment on Lambda AWS

I am trying to deploy the Webhook Example for Google Actions found here onto Lambda AWS.

I was successful deploying and making the POST calls using ngrok. So, no problems there.

But the issue i found is it uses Express node module for POST request calls. Lambda AWS fails when the request is made to Express module. So is there a way to make the POST call successful.

I tried using Lambda-Express node module to deploy it, but it seems to have some issue as well.

Lambda AWS does not directly support an HTTP interface.

One solution would be for you to use API Gateway which would allow you to translate the HTTPS POST that AoG sends, into a call to AWS Lambda.

In your lambda you will handle the request which comes in via the standard Lambda handler:

function( event, context, callback );

instead of via Express. You would probably also want to remove Express from your code, which might sound like a lot of work, but I took a brief look at it when it was released and my impression was that the dependence on Express was minor and quite unnecessary.

The alternative would be to switch from Lambda to something HTTP based like Google App Engine which is also serverless (to a degree). I guess that might be easier but I don't know what your other factors might be.

I have come across this tutorial that explains the step by step process of connecting API.ai intent using the Lambda function.

And if you follow the Google web hook example to deploy it to Lambda, then it's a wrong direction. Completely eliminate the express usage and also the Assistant class is not necessary when Lambda deployment is necessary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM