Skip to content

Commit 2bc8eb8

Browse files
committed
allowed frontend to access backend (CORS)
1 parent 0212af7 commit 2bc8eb8

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

apps/backend/app/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def create_app() -> FastAPI:
7575

7676
app.add_middleware(
7777
CORSMiddleware,
78-
allow_origins=["*"],
79-
allow_credentials=False,
78+
allow_origins=["https://collegepathfinder.vercel.app", "http://localhost:5173", "http://localhost:3000"],
79+
allow_credentials=True,
8080
allow_methods=["*"],
8181
allow_headers=["*"],
8282
)

apps/frontend/vercel.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"rewrites": [
3-
{ "source": "/(.*)", "destination": "/" }
3+
{
4+
"source": "/api/(.*)",
5+
"destination": "http://13.205.81.121:8080/$1"
6+
},
7+
{
8+
"source": "/(.*)",
9+
"destination": "/"
10+
}
411
]
512
}

0 commit comments

Comments
 (0)