Spaces:
Build error
Build error
File size: 441 Bytes
d5c46e9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
app = FastAPI()
@app.post("/webhook")
async def webhook(request: Request):
data = await request.json()
# Process the incoming data
print(f"Received data: {data}")
# Prepare a response
response_data = {
"message": "Hello! This is an automatic reply.",
"received": data
}
return JSONResponse(content=response_data)
|