mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-08 17:24:39 +00:00
fix(frontend): fix API_URL environment variable being undefined
This commit is contained in:
parent
3c850ccda8
commit
c73e84078a
3 changed files with 13 additions and 1 deletions
|
@ -2,6 +2,7 @@ import os
|
||||||
|
|
||||||
import uvicorn
|
import uvicorn
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
from modules import proxy
|
from modules import proxy
|
||||||
from modules.pages import bookmarks
|
from modules.pages import bookmarks
|
||||||
from modules.pages import favorites
|
from modules.pages import favorites
|
||||||
|
@ -52,6 +53,14 @@ app = FastAPI(
|
||||||
redoc_url=None,
|
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(profile.router, prefix=f"{PREFIX}/profile", tags=["Profile"])
|
||||||
app.include_router(auth.router, prefix=f"{PREFIX}/auth", tags=["Profile"])
|
app.include_router(auth.router, prefix=f"{PREFIX}/auth", tags=["Profile"])
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export let API_URL = "/api/v1";
|
let API_URL = "/api/v1";
|
||||||
|
|
||||||
if (process.env.API_URL) {
|
if (process.env.API_URL) {
|
||||||
API_URL = process.env.API_URL;
|
API_URL = process.env.API_URL;
|
||||||
|
|
|
@ -14,6 +14,9 @@ const nextConfig = {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
env: {
|
||||||
|
API_URL: process.env.API_URL,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|
Loading…
Add table
Reference in a new issue