fix(frontend): fix API_URL environment variable being undefined

This commit is contained in:
Kentai Radiquum 2024-05-15 20:10:49 +05:00
parent 3c850ccda8
commit c73e84078a
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
3 changed files with 13 additions and 1 deletions

View file

@ -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"])

View file

@ -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;

View file

@ -14,6 +14,9 @@ const nextConfig = {
},
],
},
env: {
API_URL: process.env.API_URL,
},
};
export default nextConfig;