mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-23 01:55:07 +02:00
Divide server.ts into 3 focused modules: - config.ts: every environment variable the server reads, parsed and validated at import time, - backend.ts: the calls made to the Docs Django backend, the token signing and the JWKS both ends verify each other with, - api.ts: the custom REST endpoints mounted under /collaboration/. server.ts keeps only what wires these together: the auth plugin and its legacy-store seed (which closes over the yhub instance), the persistence plugins, the worker events and the createYHub call. The AppAuthInfo identity shape moves to yhub.ts so server.ts and api.ts can share it without importing from each other. Tests follow the split: config.spec.ts and backend.spec.ts are new, server.spec.ts narrows to the composition root's boot contract. No behaviour change.