Spaces:
Sleeping
Sleeping
from flask import Flask, request, jsonify | |
import logging | |
app = Flask(__name__) | |
def index(): | |
content =""" | |
Hello, Webhook Receiver! <br><br> | |
curl -X POST "https://tonyassi-webhook-receiver-dev.hf.space/json" \ | |
-H "Content-Type: application/json" \ | |
-d '{"key1": "value1", "key2": "value2"}' | |
""" | |
return content | |
def handle_json(): | |
data = request.get_json() | |
print(data) | |
return jsonify(data), 200 # Return JSON response with HTTP 200 | |
if __name__ == '__main__': | |
app.run(host="0.0.0.0", port=7860) | |