diff --git a/README.md b/README.md index 4458824..ca9945f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# 90db2543e0a54b57a44d640205dd27ee - +# python hello-world diff --git a/main.py b/main.py new file mode 100644 index 0000000..0668209 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +import json +import logging as log + +def main(request): + str_data = request.get_data(cache=True, as_text=True, parse_form_data=False) + log.debug(f"dbg: {str_data}") + log.info(f"info: {str_data}") + log.warn(f"warn: {str_data}") + log.error(f"err: {str_data}") + try: + data = json.loads(str_data) + log.info(data) + except: + log.error("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