A very simple and quick Alexa skill to find airport information using an Amazon Echo. Simply ask "What airports are there in New York" or "Search for airports in Madrid" for answers.
The app uses IATA Codes API for searching for airport information.
Published Skill link: Waiting on certification...
App CreationThe app was created using create-alexa-app
, a npm
module that bootstraps Alexa skill creation for AWS Lambda deployment.
To create a new Alexa skill, simply:
$ npm install --global create-alexa-app
$ create-alexa-app ~/my-alexa-app
$ cd ~/my-alexa-app
$ npm start
This will build the application locally, reporting any compilation errors or linting warnings.
TestingTests are run using jest
, using snapshots for easy assertions.
$ npm test
> airport-search@0.1.0 test /Users/chunter/workspace/github/cameronhunter/airport-code
> alexa-scripts test
PASS src/index.test.js
✓ Launch intent (8ms)
✓ Search intent with no results (2ms)
✓ Search intent with single result (4ms)
✓ Search intent with multiple results (1ms)
✓ Help intent (1ms)
✓ Yes intent (1ms)
✓ No intent (1ms)
✓ Cancel intent (1ms)
✓ Stop intent
Test Suites: 1 passed, 1 total
Tests: 9 passed, 9 total
Snapshots: 9 passed, 9 total
Time: 0.79s, estimated 1s
Ran all test suites.
DeploymentDeploying the app still requires a little effort, but I hope to make it simpler:
$ npm run build
Package built successfully.
Details:
* Bundle: /Users/chunter/workspace/github/cameronhunter/airport-code/build/index.js
* Package: /Users/chunter/workspace/github/cameronhunter/airport-code/build/package.zip
* Package handler: index.default
The zipped package can then be manually uploaded to AWS Lambda. I plan to automate this in the future.
Comments