Compare commits

...

1 Commits
main ... v3

Author SHA1 Message Date
FunctionsAPI
a9e852b23c Automatic push from FunctionsAPI 2025-01-09 16:31:30 +00:00
3 changed files with 19 additions and 2 deletions

View File

@ -1,2 +1 @@
# b6d6b3dbc3744dd694feb7d85dfc2539
# python hello-world

16
main.py Normal file
View File

@ -0,0 +1,16 @@
import json
import logging as log
def main(request):
str_data = request.get_data(cache=True, as_text=True, parse_form_data=False)
print(f"print: {str_data}")
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 str_data

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
functions-framework==1.4.3
markupsafe==2.0.1