mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-18 12:04:45 +08: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";
|
|
}
|
|
}
|