This is the error I a getting in console console error
Here is what I tried to do. Here I used router and implemented that router in other file it is fine Using post method for signup
I used this for loginUsing post method for login
This is my main.py filemain.py
New contributor
JULAKANTI MANITH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
It seems like you had encountered a cross-origin issue, have a try adding following codes to your main.py
file:
from fastapi.middleware.cors import CORSMiddleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)