I have an AWS API gateway function connected to the following lambda function:
exports.handler = async (event,context) => {
let buff = new Buffer(event.body,"base64");
let data = buff.toString("ascii");
const response = {
statusCode: 200,
body: JSON.stringify(data + ' Hello from Lambdsa!'),
};
return response;
};
It's a POST function and the current return is:
"----------------------------866060539566167157861191\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nmyemail.dk\n\r\n----------------------------866060539566167157861191--\r\n Hello from Lambdsa!"
How can I make this base64 decoded content into JSON I can read more easily in my lambda function with the HTTP API?

