0.5.0 • Published 9 years ago

alexa-ability-express-handler v0.5.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

alexa-ability-express-handler Build Status

Example

import express from 'express';
import bodyParser from 'body-parser';
import { Ability, events } from 'alexa-ability';
import { verifyRequest, handleAbility } from 'alexa-ability-express-handler';

// build skill
const ability = new Ability();
ability.on(events.launch, function(req) {
    req.say("Testing testing one two three.").end();
});

const app = express();
app.use(bodyParser.json());
app.use(verifyRequest());
app.post('/my-intent', handleAbility(ability));

app.listen(8000, function() {
    console.log('listening');
});

API

verifyRequest(options) -> express middleware

Creates a middleware function for express that implements the body verification process required by Amazon for certification. Takes an optional options object with the following values:

  • tolerance: only accept requests with a timestamp within the given tolerance. Value defaults to 2.5 minutes in milliseconds.
  • cacheSize: maximum number of certificates to cache. Value defaults to 0.
  • cacheTime: maximum time in milliseconds to cache certificates. Value defaults to 1 day.
handleAbility(ability) -> express handler

Creates an express handler for the given ability.

0.5.0

9 years ago

0.4.4

9 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago