How can I use this framework with some serverless solutions out there (Google Cloud Functions / AWS Lambda / Azure Functions, ...)?
Thank you.
@piavgh
FastAPI supports ASGI protocol to connect a server.
The libraries are ASGI adapter which helps to run FastAPI on the services.
For AWS Lambda:
https://github.com/erm/mangum
For Azure Functions:
https://github.com/erm/bonnette
For Google Cloud Functions:
https://github.com/erm/grevillea
Example for AWS Lambda with mangum:
https://github.com/erm/mangum-examples
@koxudaxi : thank you. I will check those repos
Zeit now supports an ASGI Interface for Python.
It was fairly easy to set this up & deploy. Doesn't require making modifications to the application structure. Not sure if this would work well for most deployments (I think WebSockets would be out of question) but may be a good solution for simple apps!
I created a demo repo showcasing what I've found. Hope it can help anyone else that looks into FastAPI + Serverless: https://github.com/paul121/fastapi-zeit-now
Thanks for the help here @koxudaxi and @paul121 ! :cake: :bowing_man:
Thanks @piavgh for reporting back and closing the issue :+1:
Most helpful comment
@piavgh
FastAPI supports ASGI protocol to connect a server.
The libraries are ASGI adapter which helps to run FastAPI on the services.
For AWS Lambda:
https://github.com/erm/mangum
For Azure Functions:
https://github.com/erm/bonnette
For Google Cloud Functions:
https://github.com/erm/grevillea
Example for AWS Lambda with mangum:
https://github.com/erm/mangum-examples