From 762208f40ea3a2a489259c98b9c51fa0f6e6cb1d Mon Sep 17 00:00:00 2001 From: FunctionsAPI Date: Wed, 13 Nov 2024 10:07:34 +0000 Subject: [PATCH] Automatic push from FunctionsAPI --- README.md | 3 +-- main.py | 11 +++++++++++ requirements.txt | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 main.py create mode 100644 requirements.txt diff --git a/README.md b/README.md index c7ff428..ca9945f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# 7ff6dd8a01b140a998a6955fc073324d - +# python hello-world diff --git a/main.py b/main.py new file mode 100644 index 0000000..ee8b644 --- /dev/null +++ b/main.py @@ -0,0 +1,11 @@ +import json + +def main(request): + str_data = request.get_data(cache=True, as_text=True, parse_form_data=False) + print(str_data) + try: + data = json.loads(str_data) + print(data) + except: + print("Provided data is not a valid json") + return "hello, world" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..55e8614 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +functions-framework==1.4.3 +markupsafe==2.0.1