Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -16,6 +16,19 @@ app.add_middleware(
|
|
| 16 |
allow_headers=["*"],
|
| 17 |
)
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
@app.post("/complaints")
|
| 20 |
async def complaints_proxy(req: Request):
|
| 21 |
# 1) اقرأ اللي جاي من الصفحة
|
|
|
|
| 16 |
allow_headers=["*"],
|
| 17 |
)
|
| 18 |
|
| 19 |
+
@app.post("/recieve")
|
| 20 |
+
async def webhook_receiver(req: Request):
|
| 21 |
+
try:
|
| 22 |
+
body = await req.json()
|
| 23 |
+
except Exception:
|
| 24 |
+
body = await req.body()
|
| 25 |
+
|
| 26 |
+
print("===== RECEIVED =====")
|
| 27 |
+
print(body)
|
| 28 |
+
print("====================")
|
| 29 |
+
|
| 30 |
+
return {"ok": True}
|
| 31 |
+
|
| 32 |
@app.post("/complaints")
|
| 33 |
async def complaints_proxy(req: Request):
|
| 34 |
# 1) اقرأ اللي جاي من الصفحة
|