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