Skip to content

Commit 02b70b4

Browse files
committed
edit
1 parent cd8317b commit 02b70b4

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed
62 Bytes
Binary file not shown.

Backend/texttoAIvideo.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
from fastapi import FastAPI
2-
from fastapi.middleware.cors import CORSMiddleware
1+
from fastapi import APIRouter
2+
from fastapi.responses import JSONResponse
33

4-
app = FastAPI()
4+
router = APIRouter()
55

6-
@app.get('/api6')
6+
@router.get('/api6')
77
async def get_text_from_file():
88
with open('input.txt', 'r') as file:
99
file_text = file.read(200)
10-
return file_text
10+
return JSONResponse(content=file_text)
11+
12+
# Register the router with the main FastAPI app
13+
app.include_router(router)
1114

1215
# Configure CORS
1316
app.add_middleware(

__pycache__/main.cpython-310.pyc

-7 Bytes
Binary file not shown.

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#from Backend.summariser import router_summariser as summariser
66
from Backend.Notes_Analyser import router as api4_router
77
#from Backend.speech_text import router as api5_router
8-
from Backend.texttoAIvideo import app as api6_router
8+
from Backend.texttoAIvideo import router as api6_router
99
# import other API routers as needed
1010

1111
app = FastAPI()

0 commit comments

Comments
 (0)