Upload 5 files
Browse files
main.py
CHANGED
|
@@ -55,6 +55,13 @@ async def receive_update(req: Request):
|
|
| 55 |
|
| 56 |
return JSONResponse({"status": "replied"})
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
@app.get("/ping") # health check
|
| 59 |
def ping():
|
| 60 |
return {"pong": True}
|
|
|
|
| 55 |
|
| 56 |
return JSONResponse({"status": "replied"})
|
| 57 |
|
| 58 |
+
@app.post("/send")
|
| 59 |
+
async def check_token():
|
| 60 |
+
token = os.getenv("WHATSAPP_API_TOKEN", "")
|
| 61 |
+
if token:
|
| 62 |
+
return {"token_loaded": True}
|
| 63 |
+
raise HTTPException(status_code=400, detail="Token not found")
|
| 64 |
+
|
| 65 |
@app.get("/ping") # health check
|
| 66 |
def ping():
|
| 67 |
return {"pong": True}
|