chat / app /main.py
ariansyahdedy's picture
Initial commit
d5c46e9
raw
history blame
441 Bytes
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)