I have the following lambda function, with an API Gateway trigger point:
def lambda_handler(event, context):
resp = {
"statusCode": 200,
"headers": {
"Access-Control-Allow-Origin": "*",
},
"body": "Hello, World!"
}
return resp
When I navigate to the API endpoint, I expected to only see the text "Hello, World!". Instead, I see the entire JSON response. How do I change this function so that It interprets the headers and status code as such, and not as content to render in the browser?