feat(client): URLs relatives same-origin pour API et WebSockets (v1.1.0) - #1
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 deglobalThis.locationviaapps/client/src/lib/endpoints.ts:/api/trpc/ws/collab/ws/realtimeBreaking 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. VoirREADME.mdetCHANGELOG.md.Changements principaux
endpoints.ts+ tests Vitestquasar.config.cjs)nginx.confclient mis à jour ; suppression de l’injectionseddansdocker-entrypoint.shARG/ENVURL duDockerfileclientCLIENT_APP_URL+ALLOWED_ORIGINS(CSV)docker-compose.override.yml.examplepour bind 127.0.0.1 en debugMigration
docker compose up -d --buildAPP_SERVER_URL,COLLAB_SERVER_URL,REALTIME_SERVER_URLdu.env/api/trpc,/ws/collab,/ws/realtimeCLIENT_APP_URL; ajouterALLOWED_ORIGINSsi besoinTests
pnpm test run— 124 tests passent