Digest / app.py
qqwjq1981's picture
Update app.py
7b7ca24 verified
raw
history blame
513 Bytes
from fastapi import FastAPI, Request
import uvicorn
# Initialize FastAPI app
app = FastAPI()
# FastAPI route to handle WhatsApp webhook
@app.post("/whatsapp-webhook")
async def whatsapp_webhook(request: Request):
data = await request.json() # Parse incoming JSON data
print(f"Received data: {data}") # Log incoming data for debugging
return {"status": "success", "received_data": data}
# Run the FastAPI app with Uvicorn
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=7860)