I am new to javascript and lambda functions in aws. I have a basic requirement, to be able to push the incoming message to the dynamodb and send the status back if hash matches.
the callback function is :
enter code here const done = (err, res) => callback(null, {
statusCode: err ? '400' : '200',
body: err ? err.message : JSON.stringify(res),
headers: {
'Content-Type': 'application/json',
},
});
and from my HTTP POST call :
case 'POST':
const jsonval = JSON.parse(event.body);
const hash = crypto.createHmac('sha256', 'secret')
.update(jsonval.Item.client_name)
.digest('base64');
const **license_match** = (hash == jsonval.Item.license) ? 'true' : 'false';
dynamo.putItem(jsonval, done);
break;
I would like to return license_match (true/false) in the response object as JSON. thank you.
via firemonkey
No comments:
Post a Comment