I'm currently using NodeJS to build a bot on AWS lambda via AWS Api Gateway and I'm running into an issue with POST requests and JSON data. My api uses 'Use Lambda Proxy integration' and even when I test the proxy sending a content-type of Application/json and some json in the body e.g {"foo":"bar"}
I can't access the object without parsing it first
e.g
var json = JSON.parse(event.body);
console.log(json.foo);
Now I know this doesn't seem a big deal just running it through JSON.parse, but I've seen a number of other examples where this isn't the case at all. see here https://github.com/pinzler/fb-messenger-bot-aws-lambda/blob/master/index.js
Do I need to add anything to my API gateway to handle this correctly? my 'request body' step in the 'post method request' section has a content-type of application/json set-up for the request body.
The readme for the example above doesn't seem to use proxy integration as far as I can tell so I'm not sure what I should be doing here