I deployed both my backend (fastapi) and frontend (react) to Render. When the frontend is in development server (localhost), I could call the deployed backend from render and download the video by calling the backend api. I set all the CORS policy
app = FastAPI()
origins = [
"https://videodownload-frontend.onrender.com", # replace with the origin of your frontend
]
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
also I did not specify any designated port to be called as I saw some posts from the community saying that not specifying ports could solve the issue. Since the backend api could be called in frontend localhost, I suspect it’s the problem with my deployed frontend but not backend. Do anyone have similar problem and how to solve it? thank you
for more details, i have asked on stackoverflow