Skip to content

Commit 3cf80c9

Browse files
committed
debugging
1 parent c948ef0 commit 3cf80c9

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed
64 Bytes
Binary file not shown.

Backend/texttoAIvideo.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
from fastapi import APIRouter
2-
from starlette.middleware.cors import CORSMiddleware
3-
1+
from fastapi import APIRouter, Request
2+
from fastapi.responses import JSONResponse
43

54
router = APIRouter()
65

7-
8-
96
@router.get('/api6')
10-
async def get_text_from_file():
11-
with open('input.txt', 'r') as file:
12-
file_text = file.read(200)
13-
return file_text
14-
15-
16-
7+
async def get_text_from_user(request: Request):
8+
request_body = await request.json()
9+
user_input = request_body.get("input_text", "")
10+
file_text = user_input[:200] # Read the first 200 characters from the user input
1711

12+
return JSONResponse(content={"blendData": file_text})

__pycache__/main.cpython-310.pyc

-53 Bytes
Binary file not shown.

input.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hello
1+
fuck that niggaa

main.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
from Backend.texttoAIvideo import router as api6_router
1010
# import other API routers as needed
1111

12-
origins = [
13-
"http://localhost:3000",
14-
"https://localhost:5000",
15-
]
12+
origins = ["*"]
1613

1714

1815
app = FastAPI()

0 commit comments

Comments
 (0)