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
질문됨 2년 전1068회 조회
1개 답변
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
전문가
iwasa
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠