handler not found in main.py {lambda function }

0

"errorMessage": "Handler 'handler' missing on module 'main'", "errorType": "Runtime.HandlerNotFound",

Code : from fastapi import FastAPI from mangum import Mangum

app = FastAPI()

@app.get("/") def root(): return {"message":"Hello world"}

handler = Mangum(app,)

IN lambda function main.py file . how to resolve?

abhay
preguntada hace 2 años1073 visualizaciones
1 Respuesta
0

Hi, @abhay

You need to provide a dedicated handler there, import main.py and initialize Mangum.

Let's prepare handler = Mangum (app,) separately.

Please refer to the link below.
https://qiita.com/araki-yzrh/items/985015b9e08978e95b16

profile picture
EXPERTO
iwasa
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas