From 3a25468f3799727d0b6d3fa3003d5663bac64018 Mon Sep 17 00:00:00 2001 From: luna Date: Sat, 25 Jul 2026 08:49:11 +0000 Subject: [PATCH] fix(v2): use rjweb-server {param} syntax for URL path parameters rjweb-server 9.x uses {param} not :param for dynamic route segments. All parametric routes (/webhook/{userId}, /api/previews/{id}, etc.) were returning 404 because the server never matched them. Co-Authored-By: Claude Sonnet 4.6 --- backend/src/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index afc1161c..a5a3e578 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -54,7 +54,7 @@ server.path("/", (path) => path // Webhook server.path("/", (path) => path - .http("POST", "/webhook/:userId", (http) => http.onRequest(webhookHandler)) + .http("POST", "/webhook/{userId}", (http) => http.onRequest(webhookHandler)) ); // User settings @@ -73,15 +73,15 @@ server.path("/", (path) => path .http("GET", "/api/repos", (http) => http.onRequest(listRepos)) .http("POST", "/api/repos/config", (http) => http.onRequest(saveRepoConfig)) .http("POST", "/api/repos/toggle", (http) => http.onRequest(toggleRepoEnabled)) - .http("GET", "/api/repos/:owner/:repo/config", (http) => http.onRequest(getRepoConfig)) + .http("GET", "/api/repos/{owner}/{repo}/config", (http) => http.onRequest(getRepoConfig)) ); // Previews server.path("/", (path) => path .http("GET", "/api/previews", (http) => http.onRequest(listPreviews)) - .http("GET", "/api/previews/:id", (http) => http.onRequest(getPreview)) - .http("POST", "/api/previews/:id/stop", (http) => http.onRequest(stopPreviewRoute)) - .ws("/api/previews/:id/logs", (ws) => ws + .http("GET", "/api/previews/{id}", (http) => http.onRequest(getPreview)) + .http("POST", "/api/previews/{id}/stop", (http) => http.onRequest(stopPreviewRoute)) + .ws("/api/previews/{id}/logs", (ws) => ws .onOpen(previewLogsWs) .onMessage(async () => {}) .onClose(async () => {}) @@ -92,12 +92,12 @@ server.path("/", (path) => path server.path("/", (path) => path .http("GET", "/api/admin/users", (http) => http.onRequest(listUsers)) .http("POST", "/api/admin/users", (http) => http.onRequest(createUser)) - .http("PATCH", "/api/admin/users/:id", (http) => http.onRequest(updateUser)) - .http("DELETE", "/api/admin/users/:id", (http) => http.onRequest(deleteUser)) + .http("PATCH", "/api/admin/users/{id}", (http) => http.onRequest(updateUser)) + .http("DELETE", "/api/admin/users/{id}", (http) => http.onRequest(deleteUser)) .http("GET", "/api/admin/settings", (http) => http.onRequest(getSettings)) .http("PUT", "/api/admin/settings", (http) => http.onRequest(updateSettings)) .http("GET", "/api/admin/previews", (http) => http.onRequest(adminListPreviews)) - .http("POST", "/api/admin/previews/:id/stop", (http) => http.onRequest(adminStopPreview)) + .http("POST", "/api/admin/previews/{id}/stop", (http) => http.onRequest(adminStopPreview)) ); // Static UI — must come AFTER API routes