mardi 22 septembre 2015

Amazon Alexa Skill Lambda code won't execute

I am trying to write the Lambda function for an Amazon Alexa skill in NodeJS. Alexa is that cylindrical speaker that responds to your voice, and a "skill" is basically a voice app for it. This function takes the JSON input from the Alexa device and creates a response, then sends the new JSON back to the device for output.

This code is supposed to pull the Bitcoin to USD exchange rate from the BTC-e JSON, extract the 'avg' value, and output it to the Alexa device.

I haven't done any coding in a long time, so please forgive any stupid errors. I took the example code and tried to modify it for my purposes, but I get this error when executing in AWS:

{
  "errorMessage": "Unexpected identifier",
  "errorType": "SyntaxError",
  "stackTrace": [
    "Module._compile (module.js:439:25)",
    "Object.Module._extensions..js (module.js:474:10)",
    "Module.load (module.js:356:32)",
    "Function.Module._load (module.js:312:12)",
    "Module.require (module.js:364:17)",
    "require (module.js:380:17)"
  ]
}

My code is here. I have a feeling the problem is somewhere in lines 84-106 because that's where I did most of my work.

Thanks for any assistance!




Aucun commentaire:

Enregistrer un commentaire