mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-04 20:05:16 +02:00
Merge pull request #1459 from MODSetter/docker-hot-patch
fix(route): update backend URL handling for internal Docker network
This commit is contained in:
commit
d0194f4692
1 changed files with 10 additions and 1 deletions
|
|
@ -6,7 +6,16 @@ import type { Context } from "@/types/zero";
|
|||
import { queries } from "@/zero/queries";
|
||||
import { schema } from "@/zero/schema";
|
||||
|
||||
const backendURL = BACKEND_URL;
|
||||
// This route is invoked server-to-server by zero-cache (via ZERO_QUERY_URL),
|
||||
// so it must reach the backend over the internal Docker network
|
||||
// (e.g. http://backend:8000). The browser-facing NEXT_PUBLIC_FASTAPI_BACKEND_URL
|
||||
// (e.g. http://localhost:8929) does NOT resolve from inside the frontend
|
||||
// container and would make every authenticated Zero query fail with a 503.
|
||||
const backendURL = (
|
||||
process.env.FASTAPI_BACKEND_INTERNAL_URL ||
|
||||
BACKEND_URL ||
|
||||
"http://localhost:8000"
|
||||
).replace(/\/$/, "");
|
||||
|
||||
async function authenticateRequest(
|
||||
request: Request
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue