Automatic push from FunctionsAPI
This commit is contained in:
parent
0e362e3a64
commit
2c9d311678
15
main.py
Normal file
15
main.py
Normal file
@ -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"
|
||||
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@ -0,0 +1,2 @@
|
||||
functions-framework==1.4.3
|
||||
markupsafe==2.0.1
|
||||
Loading…
Reference in New Issue
Block a user