alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

Hosting as web service #72

Closed SomaSharathSurya closed 7 years ago

SomaSharathSurya commented 7 years ago

Hi,

I have a doubt ..will this sdk even work without lambda function? I am hosting it as a webservice by using this sdk and I am getting the following error "There was an error calling the remote endpoint, which returned HTTP 405 : Method Not Allowed" . Could you give me the clarity whether this sdk works when hosted as a webservice(i,e without using lambda func) If yes do we need any additional configuration?

Please help! Thanks in Advance!

ghost commented 7 years ago

Hey SomaSharathSurya,

I need a few more details to help you out on this. How exactly are you integrating the 'alexa-sdk' package into your webservice?

The SDK was designed to work on Lambda as the Alexa handler function depends on a lambda context object.

SomaSharathSurya commented 7 years ago

Hi bclement-amazon ,

In my webservice I am just using the alexa-sdk module and wrote the code exactly like we write in lambda function. I do not have exact idea of how to integrate 'alexa-sdk' with my webservice could you help me how to do that?

Thanks in advance!

feedm3 commented 7 years ago

The alexa sdk will only work in lambda as it uses functions which are related to lambda, like the whole context object. I would not recommend using this sdk outside of lambda!

There is another alexa server project which looks really nice. I haven't tried it out but it's worth having a look at it. It uses a standard express js server so it can be hosted everywhere: https://github.com/alexa-js/alexa-app

ghost commented 7 years ago

It's strongly encouraged within the documentation of the skills implementation that you utilize the AWS Lambda. The AWS Lambda design is oriented perfectly to correspond to the intents/actions constructed for Alexa skills. The lambda service acts as a serverless, self-maintaining, response to the intents/actions when they're invoked by the users from the voice interface, and the invocations only operate when they're called. Saving countless hours of resources, and providing for a much simpler implementation. My general rule of thumb is to not go against the instructions provided by the people who created the framework. Good luck.

Generic Overview of AWS Lambda: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html

Getting Started with AWS Lambda (PDF): http://docs.aws.amazon.com/lambda/latest/dg/lambda-dg.pdf

Custom Alexa Skills with AWS Lambda: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/developing-an-alexa-skill-as-a-lambda-function

Edit: spelling

giorgio79 commented 6 years ago

Huhh, there were no instructions that this sdk can be only used with Lambda. I was under the impression this sdk is a general purpose sdk that can be used with Lambda as well as self hosted endpoint.