mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-23 06:04:46 +08:00
feat: add NEXT_PUBLIC_BACKEND_BASE_URL
This commit is contained in:
@@ -2,16 +2,12 @@
|
||||
|
||||
import { Client as LangGraphClient } from "@langchain/langgraph-sdk/client";
|
||||
|
||||
import { getBackendBaseURL } from "../config";
|
||||
|
||||
let _singleton: LangGraphClient | null = null;
|
||||
export function getAPIClient(): LangGraphClient {
|
||||
let url: URL | null = null;
|
||||
if (typeof window === "undefined") {
|
||||
url = new URL("/api/langgraph", "http://localhost:3000");
|
||||
} else {
|
||||
url = new URL("/api/langgraph", window.location.origin);
|
||||
}
|
||||
_singleton ??= new LangGraphClient({
|
||||
apiUrl: "http://localhost:2024",
|
||||
apiUrl: getBackendBaseURL(),
|
||||
});
|
||||
return _singleton;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user