Macadamian Blog

Developing Alexa Skills Locally with ngrok and Node.JS

Christian Nadeau

How you can start developing Alexa skills locally using ngrok and your NodeJS server.

developing alexa skills locally with ngrok and node.js

We never had an easy way to develop Alexa skills locally and unit testing was one of the ways to actually test them.

Looking at the documentation for Google Home Actions, I discovered an amazing tool: ngrok!

SEE MORE: Using Rancher to Manage Docker-Machines on Azure

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.

Tags:

Author Overview

Christian Nadeau

Christian is a veteran software developer at Macadamian with specialties in .NET ( WPF, Silverlight, Window Phone 8 ), java (J2EE, JBoss), C++ (Qt, BB10). He holds a bachelor's degree in computer engineering from the University of Sherbrooke.
  • Wuelber Castillo

    That’s awesome but how do you wrap the Alexa skill around a web server made in node js?

  • Rup Sankar Mamidi

    is their any automation for alexa skills