Open j-adamczyk opened 10 months ago
I get the same error.
You're missing the request context. I got this to work:
import requests
json = {
"version": "2.0",
"routeKey": "GET /",
"rawPath": "/",
"pathParameters": {},
"requestContext": {
"http": {
"sourceIp": "192.0.0.1",
"path": "/",
"method": "GET"
}
}
}
r = requests.get(url="http://localhost:9000/2015-03-31/functions/function/invocations", json=json)
print(r.text)
I can't manage to get Mangum to work with AWS Lambda in Docker. Everything works if I just run it as a Python process, but not in Docker container.
Error:
I'm also getting the same error when I deploy on AWS Lambda.
My server:
Dockerfile:
I run it as
docker run -p 9000:8080 prediction_lambda
. I want to deploy this as Lambda Function URL, which uses API Gateway 2.0 style requests. My request:So I'm tring to reach at least the
/
endpoint with GET to debug this, but eventually for production I want to use the POST method.How can I fix this?