alexa-app-server: alexa-verifier set the "verify" flag to true and calling from a non echo throws an error
I used the example code here:
var AlexaAppServer = require("alexa-app-server");
var server = new AlexaAppServer( {
port:3000
,verify: true
,public_html: "public"
// Use preRequest to load user data on each request and add it to the request json.
// In reality, this data would come from a db or files, etc.
,preRequest: function(json,req,res) {
//console.log("preRequest fired");
//json.userDetails = { "name":"Bob Smith" };
}
// Add a dummy attribute to the response
,postRequest: function(json,req,res) {
//json.dummy = "text";
}
} );
server.start();
and added the verify flag so that I can pass the skills certification. When I try to make a request through postman it does fail (which is good) but It’s not throwing a 500, instead it throws the following error:
ReferenceError: er is not defined
at Object.handle (/my/path/node_modules/alexa-app-server/index.js:97:57)
at next_layer (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/route.js:103:13)
at Route.dispatch (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/route.js:107:5)
at /my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:195:24
at Function.proto.process_params (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:251:12)
at next (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:189:19)
at Layer.handle (/my/path/node_modules/alexa-app-server/index.js:79:15)
at trim_prefix (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:226:17)
at /my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:198:9
at Function.proto.process_params (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:251:12)
at next (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:189:19)
at next (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:166:38)
at Layer.staticMiddleware [as handle] (/my/path/node_modules/alexa-app-server/node_modules/serve-static/index.js:55:61)
at trim_prefix (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:226:17)
at /my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:198:9
at Function.proto.process_params (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:251:12)
at next (/my/path/node_modules/alexa-app-server/node_modules/express/lib/router/index.js:189:19)
at IncomingMessage.<anonymous> (/my/path/node_modules/alexa-app-server/index.js:184:5)
at emitNone (events.js:86:13)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (3 by maintainers)
I’m saying that I don’t know much about it, I didn’t write this code or actually used it myself 😉 Others like @tejashah88 or @mreinstein will know a lot more!