Merge pull request #70 from langchain-ai/dqbd/custom-auth-cors

fix(api): CORS not respected for custom auth / HTTP
This commit is contained in:
David Duong
2025-05-11 01:18:35 +02:00
committed by GitHub
+3 -2
View File
@@ -116,6 +116,9 @@ export async function startServer(options: z.infer<typeof StartServerSchema>) {
},
);
app.use(cors(options.http?.cors));
app.use(requestLogger());
if (options.auth?.path) {
logger.info(`Loading auth from ${options.auth.path}`);
await registerAuth(options.auth, { cwd: options.cwd });
@@ -128,8 +131,6 @@ export async function startServer(options: z.infer<typeof StartServerSchema>) {
app.route("/", api);
}
app.use(cors(options.http?.cors));
app.use(requestLogger());
app.use(ensureContentType());
if (!options.http?.disable_meta) app.route("/", meta);