api.py
1 """ 2 Lambda handler for a txtai API instance 3 """ 4 5 from mangum import Mangum 6 7 from txtai.api import app, start 8 9 # pylint: disable=C0103 10 # Create FastAPI application instance wrapped by Mangum 11 handler = None 12 if not handler: 13 # Start application 14 start() 15 16 # Create handler 17 handler = Mangum(app, lifespan="off")