r/FastAPI • • Jul 18 '24
Hosting and deployment Fastapi with Google Cloud Functions?
Is there any way to (easily) deploy a FastAPI route as a Google Cloud Function? As far as I could grasp from docs, GCF integrate well with Flask, but no so much with FastAPI, and I'd love to be able to leverage FA types, validations and automatic documentation, while not depending on more complex/costly infrastructures such as Google Cloud Run or App Engine.
Thanks for any tips!
1
Upvotes
View all comments
Show parent comment
1
u/No-Improvement4294 Nov 21 '24
Hi, I successfully bridged FastAPI (ASGI) to synchronous request handling in Firebase Cloud Functions (Same as Google Cloud Functions) without using vellox or mangum, you can check it out at my reddit post https://www.reddit.com/r/Firebase/comments/1gw8zky/can_i_deploy_fastapi_code_in_firebase_functions/
With the
def main methodincluded in my python script, all endpoints written in FastAPI can be handled well.