Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REST API using Google Cloud Functions

I have a general query regarding creating a simple REST API using Google Cloud Functions in Python. Is it best practice to create a HTTP function for each endpoint or create one function which handles all the endpoints?

Also is it possible to use a custom URL for the function e.g. /api/v1/pets/

like image 369
Swordfish Avatar asked Jun 21 '26 15:06

Swordfish


1 Answers

I wrote 2 articles on that topic, one in Python and the other in Golang.

But I can't recommend you to do that for real world workload, it's fun when you hack but not more. You can have a look to my first article that explain why I prefer Cloud Run to Cloud Function, and the local testing is the main argument that I can offer. Then portability.

like image 125
guillaume blaquiere Avatar answered Jun 24 '26 02:06

guillaume blaquiere



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!