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
demandé il y a 2 ans992 vues
1 réponse
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
EXPERT
iwasa
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions