Whats wrong with lambda internal server error

Lambda was a great service with great features, and serverless framework is even better, serverless simplified everything you do with AWS or other serverless providers.

Was doing some fun with serverless framework where I am simply trying to output a response from some API to Lambda API gateway, and suddenly I got “Internal server error” with lambda response:

So whats wrong with that? looking in the log it says: “Execution failed due to configuration error: Malformed Lambda proxy response” which means we have some bad format…

Turn out you need to return json format which includes “statusCode”, “header”(no necessary required), “body” as my example below:

Hope this solve your problem with the title.