One option is to use a web framework in Cloud Functions, like Express or Flask. See the official doc here . If your backend exposes many endpoints to a frontend application, you might find it easier to use Cloud Run. You'd write an application in your favorite server-side web framework (Python/Flask, Node/Express, etc). You'd run that application on your local machine for testing, without using anything specific to Google Cloud. Then you'd deploy it to the cloud with gcloud run deploy --source . I recently worked on a project where the number of Cloud Functions had grown over time. We managed for a while by adding a framework. But in the end we migrated to Cloud Run to make management of all the endpoints easier, to simplify local development, and to standardize things like authentication. Now we use Cloud Functions only to react to events like database updates. For us, that is the sweet spot for Cloud Functions. We feel that Cloud Run is great at exposing a large API surface to clients. Answer from martin_omander on reddit.com
🌐
GitHub
github.com › GoogleCloudPlatform › functions-framework-python
GitHub - GoogleCloudPlatform/functions-framework-python: FaaS (Function as a service) framework for writing portable Python functions · GitHub
An open source FaaS (Function as a service) framework for writing portable Python functions -- brought to you by the Google Cloud Functions team.
Starred by 966 users
Forked by 120 users
Languages   Python
🌐
PyPI
pypi.org › project › functions-framework › 1.4.2
functions-framework · PyPI
An open source FaaS (Function as a service) framework for writing portable Python functions -- brought to you by the Google Cloud Functions team.
      » pip install functions-framework
    
Published   May 13, 2020
Version   1.4.2
🌐
GitHub
github.com › OpenFunction › functions-framework-python
GitHub - OpenFunction/functions-framework-python
An open source FaaS (Function as a service) framework for writing portable Python functions.
Author   OpenFunction
🌐
DEV Community
dev.to › bornfightcompany › testing-cloud-functions-with-functions-framework-in-python-9cf
Testing Cloud Functions with functions-framework in python - DEV Community
September 5, 2021 - You need two terminal sessions to do this, one to run the functions-framework, the other to send the message. In terminal 1, run: python3 setup-functions-fmwk.py bi-project test-environment pipedrive-legacy-run-hourly · to setup the environment, then call functions framework: functions-framework --target run --signature-type event ·
🌐
Reddit
reddit.com › r/googlecloud › how am i supposed to use functions-framework to test my cloud functions?
r/googlecloud on Reddit: How am I supposed to use functions-framework to test my cloud functions?
February 23, 2023 -

It seems like whenever you run `functions-framework` locally, it deploys your function on localhost on a port of your choosing. This works great if you are developing a new function and just need to test it in a quick and easy way, but how are you supposed to write code that lets you easily develop and test multiple functions over time? I'm aware that firebase might solve that, but the reason I am asking this question is to understand what the state-of-the-art is outside of firebase.

The problem is, if I have code that hits my function URL, and then I want to update the function and test it as part of my application, it seems like I have to set a per-function environment variable that swaps out the HTTP trigger uri for the localhost:PORT testing URI. That's pretty annoying when you have to have a separate env variable for each function you might test.

Surely I'm missing something here? What do people do in this situation?

EDIT: Found this github issue (https://github.com/GoogleCloudPlatform/functions-framework-nodejs/issues/23) that seems to indicate that there's no equivalent solution to firebase/the old functions emulator for serving multiple functions locally, but you can fairly easily work around it by writing a little bit of code to multiplex your functions manually. I wish this was included in the official docs rather than just in the Github Issue!

🌐
GitHub
github.com › GoogleCloudPlatform › functions-framework
GitHub - GoogleCloudPlatform/functions-framework: The Contract for Building New Function Frameworks · GitHub
Controls unmarshalling rules and determines which arguments are used to invoke your function. The Functions Framework library may provide a way to express the function signature type in code, such as through registration APIs or annotations, ...
Starred by 158 users
Forked by 15 users
🌐
Google Cloud
cloud.google.com › cloud run › local functions development
Functions Framework | Cloud Run functions Documentation
Command-line arguments must be specified when you run the framework. Note: Command-line arguments take precedence over environment variables when running the Python Functions Framework.
🌐
DEV Community
dev.to › googlecloud › portable-cloud-functions-with-the-python-functions-framework-a6a
Portable Cloud Functions with the Python Functions Framework - DEV Community
February 17, 2021 - How to use the recently published Functions Framework for Python to target alternate deployment environments and more.
Find elsewhere
🌐
GitHub
github.com › GoogleCloudPlatform › functions-framework-python › blob › main › src › functions_framework › __init__.py
functions-framework-python/src/functions_framework/__init__.py at main · GoogleCloudPlatform/functions-framework-python
FaaS (Function as a service) framework for writing portable Python functions - functions-framework-python/src/functions_framework/__init__.py at main · GoogleCloudPlatform/functions-framework-python
Author   GoogleCloudPlatform
🌐
PyPI
pypi.org › project › ofn-functions-framework
ofn-functions-framework · PyPI
An open source FaaS (Function as a service) framework for writing portable Python functions.
      » pip install ofn-functions-framework
    
Published   Aug 15, 2023
Version   0.2.0rc1
🌐
Google
docs.cloud.google.com › cloud run › write cloud run functions
Write Cloud Run functions | Google Cloud Documentation
import functions_framework # Register an HTTP function with the Functions Framework @functions_framework.http def my_http_function(request): # Your code here # Return an HTTP response return 'OK' In Python, you register an HTTP handler function with the Functions Framework for Python.
🌐
GitHub
github.com › OpenFunction › functions-framework-python-gcp
GitHub - OpenFunction/functions-framework-python-gcp: FaaS (Function as a service) framework for writing portable Python functions
An open source FaaS (Function as a service) framework for writing portable Python functions.
Starred by 4 users
Forked by 5 users
Languages   Python 99.9% | HTML 0.1% | Python 99.9% | HTML 0.1%
🌐
Medium
nakamasato.medium.com › cloud-functions-series3-run-cloud-functions-in-local-python-158044fc4df9
Cloud Functions Series3: Run Cloud Functions in local (Python) | by Masato Naka | Medium
June 29, 2024 - functions-framework accelerates the speed of testing and debugging Cloud Functions apps in you your local development.
🌐
GitHub
github.com › GoogleCloudPlatform › functions-framework-python › blob › main › src › functions_framework › _cli.py
functions-framework-python/src/functions_framework/_cli.py at main · GoogleCloudPlatform/functions-framework-python
FaaS (Function as a service) framework for writing portable Python functions - functions-framework-python/src/functions_framework/_cli.py at main · GoogleCloudPlatform/functions-framework-python
Author   GoogleCloudPlatform
🌐
OneUptime
oneuptime.com › home › blog › how to write and deploy python cloud functions gen 2
How to Write and Deploy Python Cloud Functions Gen 2
February 17, 2026 - The Functions Framework is the open-source library that makes your function deployable - it handles the HTTP server, request parsing, and event deserialization so you can focus on your business logic.
🌐
DeepWiki
deepwiki.com › GoogleCloudPlatform › functions-framework-python › 4-deployment-examples
Deployment | GoogleCloudPlatform/functions-framework-python | DeepWiki
November 15, 2025 - The Functions Framework is distributed as a Python package on PyPI under the name functions-framework.