An AWS Lambda function using the Node.js 22.x runtime should look something like this:
export const handler = async (event, context) => { (1)
const response = {
statusCode: 200,
body: JSON.stringify({
message: "Hello, World!"
})
};
return response; (2)
};
1 | The handler function has two parameters:
|
||||||||||||||||||
2 | The handler should return an object from which the HTTP response will be constructed.
|