From ee0483f2a70ef82023413d3bb30f244ea97c539b Mon Sep 17 00:00:00 2001 From: gitadmin Date: Sat, 2 May 2026 13:18:50 +0000 Subject: [PATCH] fix: Express 5 named wildcard in corpus-gather stub --- routes/corpus-gather.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/routes/corpus-gather.ts b/routes/corpus-gather.ts index e514ff3..907b2aa 100644 --- a/routes/corpus-gather.ts +++ b/routes/corpus-gather.ts @@ -13,7 +13,7 @@ import type { Express } from "express"; const WORKER_URL = process.env.CORPUS_GATHER_WORKER_URL || null; export function registerCorpusGatherRoutes(app: Express) { - app.all("/api/corpus/gather*", async (req: any, res: any) => { + async function gatherHandler(req: any, res: any) { if (WORKER_URL) { try { const upstream = await fetch(`${WORKER_URL}${req.path}`, { @@ -29,7 +29,9 @@ export function registerCorpusGatherRoutes(app: Express) { } res.status(503).json({ error: "corpus-gather-worker not configured", - hint: "Set CORPUS_GATHER_WORKER_URL to the Hetzner worker URL, or run corpus-gather-worker.ts locally.", + hint: "Set CORPUS_GATHER_WORKER_URL to the Hetzner worker URL.", }); - }); + } + app.all("/api/corpus/gather", gatherHandler); + app.all("/api/corpus/gather/*path", gatherHandler); }