Functions-framework
Functions framework helps in setting up the environment for testing of cloud functions locally
Here is an example
installation
1 | pip install functions-framework |
code example:
create a new project and install functions-framework as above, and then create a new python file main.py
1 | def multiply(request): |
run the function on local:
1 | functions-framework --port 8080 --target multiply --signature-type http --source main.py --debug |
Test the function
use another terminal and enter the curl command:
1 | curl -X POST \ |
Response in this new terminal:
