Your function needs to be:
export async function handler({body}) {
return {
statusCode: 200,
body: Buffer.from(body, 'base64').toString('utf8')
};
}
Because of:
Demo: https://quirky-mirzakhani-33e90a.netlify.app/
Note that, the above would return the decoded string so example com
in your case.