Package Exports
- alexa-verifier-middleware
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (alexa-verifier-middleware) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
alexa-verifier-middleware
Verify HTTP requests sent to an Alexa skill are sent from Amazon.
This is an express middleware that wraps logic in the alexa-verifier module.
Usage
var express = require('express');
var avm = require('alexa-verifier-middleware');
var app = express();
app.use(avm()); // install the verifier middleware
// other body parsers, etc. follow...Usage with other body parser middlewares
This middleware needs to read the entire request body, and express doesn't expose that on the request object. If you are using any other body parsing middleware, you must load this one first.
Example:
var express = require('express');
var bodyParser = require('body-parser');
var avm = require('alexa-verifier-middleware');
var app = express();
// note that the 'avm' middleware is loaded first
app.use(avm());
// now you can load other body parser related middlewares here
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());If there is another middleware that says it needs to load first, and you are not sure which placement is better, let me know by opening an issue and I'll do some extensive testing before reporting which middleware to load first.
Mentions
- mreinstein for his alexa-verifier module, which allows you to verify any Amazon requests from any web service
