This article describes how to create an HTTP API that calls a Lambda under a node runtime.
I just tried doing the same with a Python lambda with the following handler:
def lambda_handler(event, context):
return {
'statusCode': 200,
'body': "\"Hello from Lambda!\""
};
When tested within the Lambda editor, this Lambda returns the exact same as the node Lambda from the article, namely
{
"statusCode": 200,
"body": "\"Hello from Lambda!\""
}
However, the node function works when attached to an HTTP API and navigated to in the browser, while the Python one gives a
{"message":"Internal Server Error"}
What can I do to make it work?