Skip to content
This repository was archived by the owner on Jul 3, 2025. It is now read-only.

Commit f7bee2f

Browse files
authored
Merge pull request #70 from langchain-ai/dqbd/custom-auth-cors
fix(api): CORS not respected for custom auth / HTTP
2 parents 4f3d544 + f13e1f1 commit f7bee2f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libs/langgraph-api/src/server.mts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ export async function startServer(options: z.infer<typeof StartServerSchema>) {
116116
},
117117
);
118118

119+
app.use(cors(options.http?.cors));
120+
app.use(requestLogger());
121+
119122
if (options.auth?.path) {
120123
logger.info(`Loading auth from ${options.auth.path}`);
121124
await registerAuth(options.auth, { cwd: options.cwd });
@@ -128,8 +131,6 @@ export async function startServer(options: z.infer<typeof StartServerSchema>) {
128131
app.route("/", api);
129132
}
130133

131-
app.use(cors(options.http?.cors));
132-
app.use(requestLogger());
133134
app.use(ensureContentType());
134135

135136
if (!options.http?.disable_meta) app.route("/", meta);

0 commit comments

Comments
 (0)