From fcc106349cb6a17af0f83e1c5650535e38ce127b Mon Sep 17 00:00:00 2001 From: FunctionsAPI Date: Tue, 5 Nov 2024 09:52:10 +0000 Subject: [PATCH] Automatic push from FunctionsAPI --- README.md | 3 +-- ___init___.py | 0 main.py | 13 +++++++++++++ requirements.txt | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 ___init___.py create mode 100644 main.py create mode 100644 requirements.txt diff --git a/README.md b/README.md index 8f79b6b..ca9945f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# fd9cf080d5f44666922da151b9a8232d - +# python hello-world diff --git a/___init___.py b/___init___.py new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py new file mode 100644 index 0000000..6e4b6a0 --- /dev/null +++ b/main.py @@ -0,0 +1,13 @@ +import logging + +# Configure the logging +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') + + +def main(request): + logging.info(f"Function called with request: {request}") + + data = request.get_json(force=True) + + logging.info(f"Received data: {data}") + return {"result": data.get("a", 0)+data.get("b", 0)} \ No newline at end of file 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