Skip to content

feat(client): URLs relatives same-origin pour API et WebSockets (v1.1.0) - #1

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/relative-backend-urls-5cf1
May 23, 2026
Merged

feat(client): URLs relatives same-origin pour API et WebSockets (v1.1.0)#1
cursor[bot] merged 1 commit into
mainfrom
cursor/relative-backend-urls-5cf1

Conversation

@Emilien-Etadam

Copy link
Copy Markdown
Owner

Résumé

Le client Vue/Quasar n’utilise plus d’URLs absolues vers les ports backend (APP_SERVER_URL, COLLAB_SERVER_URL, REALTIME_SERVER_URL). Les endpoints sont dérivés de globalThis.location via apps/client/src/lib/endpoints.ts :

  • HTTP tRPC : /api/trpc
  • Collab WS : /ws/collab
  • Realtime WS : /ws/realtime

Breaking change

Un reverse proxy (NPM, nginx, ou le nginx du conteneur client) doit exposer ces trois chemins sur le même origin que le SPA. Voir README.md et CHANGELOG.md.

Changements principaux

  • Module endpoints.ts + tests Vitest
  • Proxy Vite en dev (quasar.config.cjs)
  • nginx.conf client mis à jour ; suppression de l’injection sed dans docker-entrypoint.sh
  • Suppression des ARG/ENV URL du Dockerfile client
  • CORS app-server : CLIENT_APP_URL + ALLOWED_ORIGINS (CSV)
  • docker-compose.override.yml.example pour bind 127.0.0.1 en debug
  • Version client 1.1.0

Migration

  1. Rebuild : docker compose up -d --build
  2. Retirer APP_SERVER_URL, COLLAB_SERVER_URL, REALTIME_SERVER_URL du .env
  3. Configurer le proxy pour /api/trpc, /ws/collab, /ws/realtime
  4. Conserver CLIENT_APP_URL ; ajouter ALLOWED_ORIGINS si besoin

Tests

  • pnpm test run — 124 tests passent
Open in Web Open in Cursor 

The SPA resolves /api/trpc, /ws/collab, and /ws/realtime from
window.location instead of build-time backend URLs. Adds Vite dev
proxy, updates bundled nginx, CORS via ALLOWED_ORIGINS, and bumps
client to 1.1.0 (breaking change — reverse proxy required).

Co-authored-by: émilien <Emilien-Etadam@users.noreply.github.com>
@cursor
cursor Bot merged commit 687a346 into main May 23, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants