From ad433c4dbcfafc4d15c03c1db168b05ce93df2c8 Mon Sep 17 00:00:00 2001 From: Honey Date: Thu, 30 Jul 2026 21:54:36 +0200 Subject: [PATCH] fix(backend): Deezer proxy route crashed the whole server on Express 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `app.get('/api/deezer/*', …)` — a bare "*" — throws "Missing parameter name" in Express 5's path-to-regexp at startup, so the server never came up and EVERY endpoint (abs-proxy, romaji-overrides, deezer, …) failed with a CORS/ERR_FAILED in the browser. Use a RegExp route instead, which registers cleanly on both Express 4 and 5. Verified against express 5.2.1: bare "*" crashes, the regex is OK. Co-Authored-By: Claude Opus 4.8 --- backend/novasonic-server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/novasonic-server.js b/backend/novasonic-server.js index 2d97ad3..50006d3 100644 --- a/backend/novasonic-server.js +++ b/backend/novasonic-server.js @@ -327,7 +327,9 @@ app.get('/api/itunes/:endpoint', (req, res) => { // Deezer API proxy — the search source (Apple's /search returns 403 from server IPs). Deezer is // free, needs no key, and returns explicit versions + artist images + track durations. Covers // /search, /search/album, /search/artist, /album/{id}, /album/{id}/tracks, /artist/{id}/albums, … -app.get('/api/deezer/*', (req, res) => { +// Regex route (not '/api/deezer/*') — a bare "*" is an invalid path pattern in Express 5 and +// crashes the server at startup, taking every endpoint down with it. +app.get(/^\/api\/deezer\/(.+)/, (req, res) => { const sub = String(req.params[0] || '').replace(/[^a-zA-Z0-9/_-]/g, ''); const qs = new URLSearchParams(req.query).toString(); const target = `https://api.deezer.com/${sub}${qs ? '?' + qs : ''}`;