mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-04-29 21:38:09 +00:00
23 lines
588 B
TypeScript
23 lines
588 B
TypeScript
import { env } from "@/env";
|
|
|
|
export function getBackendBaseURL() {
|
|
if (env.NEXT_PUBLIC_BACKEND_BASE_URL) {
|
|
return env.NEXT_PUBLIC_BACKEND_BASE_URL;
|
|
} else {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
export function getLangGraphBaseURL() {
|
|
if (env.NEXT_PUBLIC_LANGGRAPH_BASE_URL) {
|
|
return env.NEXT_PUBLIC_LANGGRAPH_BASE_URL;
|
|
} else {
|
|
// LangGraph SDK requires a full URL, construct it from current origin
|
|
if (typeof window !== "undefined") {
|
|
return `${window.location.origin}/api/langgraph`;
|
|
}
|
|
// Fallback for SSR
|
|
return "http://localhost:2026/api/langgraph";
|
|
}
|
|
}
|