mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-04-25 11:18:22 +00:00
fix(config): return full URLs for backend and LangGraph base URLs (#1392)
This commit is contained in:
parent
a087fe7bcc
commit
4d1a69a938
@ -2,7 +2,10 @@ import { env } from "@/env";
|
||||
|
||||
export function getBackendBaseURL() {
|
||||
if (env.NEXT_PUBLIC_BACKEND_BASE_URL) {
|
||||
return env.NEXT_PUBLIC_BACKEND_BASE_URL;
|
||||
return new URL(
|
||||
env.NEXT_PUBLIC_BACKEND_BASE_URL,
|
||||
window.location.origin,
|
||||
).toString();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
@ -10,7 +13,10 @@ export function getBackendBaseURL() {
|
||||
|
||||
export function getLangGraphBaseURL(isMock?: boolean) {
|
||||
if (env.NEXT_PUBLIC_LANGGRAPH_BASE_URL) {
|
||||
return env.NEXT_PUBLIC_LANGGRAPH_BASE_URL;
|
||||
return new URL(
|
||||
env.NEXT_PUBLIC_LANGGRAPH_BASE_URL,
|
||||
window.location.origin,
|
||||
).toString();
|
||||
} else if (isMock) {
|
||||
if (typeof window !== "undefined") {
|
||||
return `${window.location.origin}/mock/api`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user