Mr-Help commited on
Commit
2ff42c3
·
verified ·
1 Parent(s): fd2c062

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
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