Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI, Request
|
| 2 |
+
|
| 3 |
+
app = FastAPI()
|
| 4 |
+
|
| 5 |
+
@app.post("/")
|
| 6 |
+
async def echo(request: Request):
|
| 7 |
+
data = await request.json() # Parse the incoming JSON
|
| 8 |
+
print("Received:", data) # Print the received data
|
| 9 |
+
return {"message": "Received", "data": data} # Return the data as response
|
| 10 |
+
|
| 11 |
+
# Run the server using: uvicorn filename:app --reload
|