diff --git a/deploy/nginx/common/routes.conf b/deploy/nginx/common/routes.conf index 30a582a1b..9ca3204ad 100644 --- a/deploy/nginx/common/routes.conf +++ b/deploy/nginx/common/routes.conf @@ -59,10 +59,10 @@ location ~ ^/ContentService/exporter/(diagram|document|event)/ { proxy_send_timeout 300s; } -# DeltaSignal. Apache has no such route, which is why DeltaSignal cannot work on -# beta today: the Angular side calls /api/pathways, /api/parse and /api/solve as -# bare relative paths, routed only by proxy.conf.js — the dev server's proxy, -# which does not exist in a built artifact. +# DeltaSignal. The Angular side calls /api/pathways, /api/parse and /api/solve as +# bare relative paths: proxy.conf.js routes them under the dev server, and this +# route in a built deployment. A site profile turns the Perturb button on only +# where one of the two exists (environments.ts, `deltaSignal`). location /api/ { include /etc/nginx/common/upstream-proxy.conf; proxy_pass http://deltasignal/api/; diff --git a/projects/website-angular/src/config/environments.spec.ts b/projects/website-angular/src/config/environments.spec.ts index cb58458c5..7003c8f5d 100644 --- a/projects/website-angular/src/config/environments.spec.ts +++ b/projects/website-angular/src/config/environments.spec.ts @@ -121,13 +121,13 @@ describe('site profiles', () => { }); it('offers DeltaSignal only where a DeltaSignal backend can be reached', () => { - // /api is routed by proxy.conf.js, which is the dev server's proxy: it does - // not exist in a built artifact, and nothing in deploy.yml or the Apache - // config provides it. A deployment that turned this on would offer a button - // whose every call fails, so only `development` may have it until there is a - // deployed backend to point at. + // /api is routed by proxy.conf.js under the dev server, and by beta's nginx + // (deploy/nginx/common/routes.conf) to the DeltaSignal service on the same + // host. A deployment that turned this on without either would offer a + // button whose every call fails, so only those two may have it. + const reachable = ['development', 'beta']; for (const [name, profile] of Object.entries(SITE_PROFILES)) { - expect(profile.deltaSignal === true, `${name}.deltaSignal`).toBe(name === 'development'); + expect(profile.deltaSignal === true, `${name}.deltaSignal`).toBe(reachable.includes(name)); } }); diff --git a/projects/website-angular/src/config/environments.ts b/projects/website-angular/src/config/environments.ts index f08fa2ebc..4476a00a0 100644 --- a/projects/website-angular/src/config/environments.ts +++ b/projects/website-angular/src/config/environments.ts @@ -182,6 +182,10 @@ export const SITE_PROFILES: Record = { searchAnswerEndpoint: '/search-answer', analysisSummaryEndpoint: '/analysis-summary', chatHandoffEndpoint: '/chat-handoff', + // Beta's nginx routes /api/ to the DeltaSignal service on this host + // (deploy/nginx/common/routes.conf), so the Perturb button's calls are + // answered here as they are under the dev server's proxy. + deltaSignal: true, host: 'origin', originFallback: 'https://beta.reactome.org', s3: S3, @@ -196,10 +200,10 @@ export const SITE_PROFILES: Record = { development: { variant: 'main', - // The only deployment that can reach a DeltaSignal backend: proxy.conf.js - // routes /api to DELTASIGNAL_BACKEND, which is a dev-server proxy and does - // not exist in a built artifact. Turning this on elsewhere would offer a - // button whose every call fails, so the other profiles leave it absent. + // proxy.conf.js routes /api to DELTASIGNAL_BACKEND under the dev server; + // beta's nginx routes it the same way. Turning this on where neither + // proxies /api would offer a button whose every call fails, so the other + // profiles leave it absent. deltaSignal: true, // Same reasoning, and note the path: `/api` above already belongs to the // DeltaSignal backend, so the answer proxy cannot live under it.