diff --git a/functions/concepts-stateless/main.py b/functions/concepts-stateless/main.py index 062a12bc2eb5..cf9b9e7a7b20 100644 --- a/functions/concepts-stateless/main.py +++ b/functions/concepts-stateless/main.py @@ -12,14 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import time +# [START functions_concepts_stateless] +import functions_framework -# [START functions_concepts_stateless] # Global variable, modified within the function by using the global keyword. count = 0 +@functions_framework.http def statelessness(request): """ HTTP Cloud Function that counts how many times it is executed diff --git a/functions/concepts-stateless/requirements-test.txt b/functions/concepts-stateless/requirements-test.txt index e80042419ca0..474ff7c906ae 100644 --- a/functions/concepts-stateless/requirements-test.txt +++ b/functions/concepts-stateless/requirements-test.txt @@ -1,2 +1,3 @@ flask==2.1.0 pytest==7.0.1 +functions-framework==3.3.0 diff --git a/functions/concepts-stateless/requirements.txt b/functions/concepts-stateless/requirements.txt new file mode 100644 index 000000000000..5f5d4e8daee2 --- /dev/null +++ b/functions/concepts-stateless/requirements.txt @@ -0,0 +1 @@ +functions-framework==3.3.0