diff --git a/backend/main.py b/backend/main.py index 3c5194b..b33bf54 100644 --- a/backend/main.py +++ b/backend/main.py @@ -2,6 +2,7 @@ import os import uvicorn from fastapi import FastAPI +from fastapi.middleware.cors import CORSMiddleware from modules import proxy from modules.pages import bookmarks from modules.pages import favorites @@ -52,6 +53,14 @@ app = FastAPI( redoc_url=None, ) +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["GET", "POST"], + allow_headers=["*"], +) + app.include_router(profile.router, prefix=f"{PREFIX}/profile", tags=["Profile"]) app.include_router(auth.router, prefix=f"{PREFIX}/auth", tags=["Profile"]) diff --git a/frontend/app/api/config.js b/frontend/app/api/config.js index 7eb8ada..2491dd2 100644 --- a/frontend/app/api/config.js +++ b/frontend/app/api/config.js @@ -1,4 +1,4 @@ -export let API_URL = "/api/v1"; +let API_URL = "/api/v1"; if (process.env.API_URL) { API_URL = process.env.API_URL; diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index ac54bb9..d4ce4b0 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -14,6 +14,9 @@ const nextConfig = { }, ], }, + env: { + API_URL: process.env.API_URL, + }, }; export default nextConfig;