Given that you have this type of lambda function:
exports.handler = function(event, context) {
var data={"test":"data"};
context.done( null,
( !!event.cb && event.cb.length > 0 )
? event.cb.replace( /[^a-z0-9_]/i, '' ) + '(' + JSON.stringify( data ) + ')'
: data
);
};
When you give it an event like
{
"cb": "callback"
}
He will give this result:
"callback({\"test\":\"data\"})"
So far so good. Now you go to the Gateway API and in the Integration Response section you write this
$util.parseJson($input.json('$'))
What will you get callback({"test":"data"})as output when you call the API gateway endpoint.