2025-05-28 12:26:47 -07:00
|
|
|
import { initApiPassthrough } from "langgraph-nextjs-api-passthrough";
|
2025-06-11 14:00:08 -07:00
|
|
|
import { GITHUB_TOKEN_COOKIE } from "@open-swe/shared/constants";
|
2025-05-28 12:26:47 -07:00
|
|
|
|
|
|
|
|
// This file acts as a proxy for requests to your LangGraph server.
|
|
|
|
|
// Read the [Going to Production](https://github.com/langchain-ai/agent-chat-ui?tab=readme-ov-file#going-to-production) section for more information.
|
|
|
|
|
|
|
|
|
|
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS, runtime } =
|
|
|
|
|
initApiPassthrough({
|
2025-06-11 14:00:08 -07:00
|
|
|
apiUrl: process.env.LANGGRAPH_API_URL ?? "http://localhost:2024",
|
2025-05-28 12:26:47 -07:00
|
|
|
runtime: "edge", // default
|
2025-06-11 14:00:08 -07:00
|
|
|
disableWarningLog: true,
|
|
|
|
|
headers: (req) => {
|
|
|
|
|
return {
|
|
|
|
|
[GITHUB_TOKEN_COOKIE]:
|
|
|
|
|
req.cookies.get(GITHUB_TOKEN_COOKIE)?.value ?? "",
|
|
|
|
|
};
|
|
|
|
|
},
|
2025-05-28 12:26:47 -07:00
|
|
|
});
|