We never had an easy way to develop Alexa skills locally and unit testing was one of the ways to actually test them.
What does it do? It exposes your localhost publicly through an HTTP tunnel. This way, you can simply run your local NodeJS server.
$ npm install $ npm start server listening on localhost:3000
Then, in another terminal (once your ngrok executable is in your $PATH)
ngrok http -bind-tls=true -host-header=rewrite 3000
Copy the https URL displayed by ngrok and paste it as the host for your Alexa skill configuration.
At first, it did not work because the SSL certificate is not detected as valid and it leads to a signature chain verification failure.
BUT, changing the Alexa skill SSL Certificate configuration to:
My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority
allowed the skill to be accessible!
And voilà! Enjoy developing your skill locally without having to redeploy all the time.
This post originally appeared on Medium
Insights delivered to your inbox
Subscribe to the dev blog to get the latest insights in IoT, Alexa Skills development, and software development.