bespoken / virtual-alexa

:robot: Easily test and debug Alexa skills programmatically
https://bespoken.io
Apache License 2.0
112 stars 35 forks source link

Howto: use a locally hosted lambda #102

Closed anandmukundan closed 5 years ago

anandmukundan commented 5 years ago

Hi

I have a lambda hosted in localstack. How can I use that as the handler for running virtual-alexa? (This is not a JS based lambda, so cannot use the normal handler syntax).

Since it is not really a hosted endpoint, I am unable to use the url property.

jkelvie commented 5 years ago

Hi @anandmukundan - you can still use it with Virtual Alexa, assuming you have an API gateway configured as a passthru to your lambda.

You need to make sure that the localstack server is running, then setup virtual alexa with this property:

const alexa = va.VirtualAlexa.Builder()
    .skillURL("http://localhost:4567") // Local stack API gateway
    .interactionModelFile("./models/en-US.json") // Path to interaction model file
    .create();
anandmukundan commented 5 years ago

Thanks @jkelvie, that is what I suspected, but thanks for the confirmation