File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 55from pathlib import Path
66from fastapi import FastAPI
77from fastapi .responses import JSONResponse
8+ from mangum import Mangum
89
910# Set minimal config for serverless environment
1011os .environ .setdefault ("OMNISCIENT_DEBUG" , "false" )
2021
2122# Initialize app variable
2223app = None
24+ handler = None
2325initialization_error = None
2426
2527try :
2830
2931 # Create the app instance for Vercel
3032 app = create_app ()
33+ handler = Mangum (app )
3134
3235except Exception as e :
3336 # Store error for debugging
@@ -48,6 +51,11 @@ async def read_root():
4851 "name" : "Omniscient Architect API" ,
4952 "status" : "degraded" ,
5053 "error" : "API initialization failed" ,
54+ "details" : initialization_error ,
55+ "traceback" : error_traceback .split ("\n " )
56+ }
57+
58+ handler = Mangum (app )
5159 "detail" : initialization_error ,
5260 "traceback" : error_traceback ,
5361 "message" : "Please check logs and package installation" ,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ rich>=13.7.0
1313fastapi >= 0.104.0
1414uvicorn >= 0.24.0
1515python-multipart >= 0.0.6
16+ mangum >= 0.17.0
1617
1718# GitHub integration
1819PyGitHub >= 2.1.0
You can’t perform that action at this time.
0 commit comments