Fix preview app startup on Node 22 (Express 5 route syntax) (#2536)

Express was bumped 4.21.2 -> 5.2.1, whose router uses path-to-regexp v8 which removed inline-regex route params. The route /pull/:pr(\d+) threw PathError at startup. Switch to /pull/:pr (handler already validates with /^\d+\$/ and returns 400).

Also update deploy runtime to NODE:22-lts and drop the stray 'node' and unused top-level 'path-to-regexp' dependencies.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7793a516-0204-44e1-bed5-d8ad91b9400a
This commit is contained in:
jawelton74
2026-07-16 08:58:22 -07:00
committed by GitHub
parent 4a881651d5
commit cbac5f9a95
3 changed files with 4 additions and 32 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ const app = express();
app.use("/api", api);
app.use("/proxy", proxy);
app.use("/commit", commit);
app.get("/pull/:pr(\\d+)", (req, res) => {
app.get("/pull/:pr", (req, res) => {
const pr = req.params.pr;
if (!/^\d+$/.test(pr)) {
return res.status(400).send("Invalid pull request number");