Update app/app.py
Browse files- app/app.py +10 -1
app/app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from contextlib import asynccontextmanager
|
2 |
-
|
3 |
from fastapi import Depends, FastAPI
|
4 |
|
5 |
from .db import User, create_db_and_tables
|
@@ -22,6 +22,15 @@ app = FastAPI(
|
|
22 |
description="Your Excellect AI Physician",
|
23 |
lifespan=lifespan
|
24 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
app.include_router(
|
26 |
fastapi_users.get_auth_router(auth_backend), prefix="/auth/jwt", tags=["auth"]
|
27 |
)
|
|
|
1 |
from contextlib import asynccontextmanager
|
2 |
+
from fastapi.middleware.cors import CORSMiddleware
|
3 |
from fastapi import Depends, FastAPI
|
4 |
|
5 |
from .db import User, create_db_and_tables
|
|
|
22 |
description="Your Excellect AI Physician",
|
23 |
lifespan=lifespan
|
24 |
)
|
25 |
+
|
26 |
+
app.add_middleware(
|
27 |
+
CORSMiddleware,
|
28 |
+
allow_origins=["*"],
|
29 |
+
allow_credentials=True,
|
30 |
+
allow_methods=["*"],
|
31 |
+
allow_headers=["*"],
|
32 |
+
)
|
33 |
+
|
34 |
app.include_router(
|
35 |
fastapi_users.get_auth_router(auth_backend), prefix="/auth/jwt", tags=["auth"]
|
36 |
)
|