19 lines
392 B
Python
19 lines
392 B
Python
import json
|
|
|
|
|
|
def push_to_pubsub(request_params):
|
|
print(json.dumps(request_params))
|
|
|
|
|
|
def main(request):
|
|
request_json = request.get_json(silent=True)
|
|
request_args = request.args
|
|
|
|
if request_json:
|
|
push_to_pubsub(request_json)
|
|
elif request_args:
|
|
push_to_pubsub(request_args)
|
|
else:
|
|
raise Exception("No data provided.")
|
|
return {"status": "ok"}
|