An open source FaaS (Function as a service) framework for writing portable Python functions -- brought to you by the Google Cloud Functions team.
The Functions Framework lets you write lightweight functions that run in many different environments, including:
- Google Cloud Functions
- Your local development machine
- Cloud Run and Cloud Run for Anthos
- Knative-based environments
def hello(request):
return "Hello world!"
-
Build a container from your function using the Functions buildpacks:
bash sbin/build.sh
-
Start the built container:
bash sbin/run.sh # Output: Serving function...
-
Send requests to this function using
curl
from another terminal window:curl localhost:8080 # Output: Hello World!