You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Static service: forward paths to another service (same-origin API for a static SPA in a profile) #551
ADR-0041 profiles are meant to replace a hand-written acceptance setup (#115). For a single-page app that talks to its API same-origin (relative /api, as in production behind a reverse proxy), kind = "static" is not enough: devstack serves the bundle's files only, so every /api/... request gets the SPA's index.html or a 404.
In development the dev server covers this with its proxy config (ng serve --proxy-config, Vite server.proxy). A profile that turns that dev server into kind = "static" loses the proxy, and there is nothing in the stack file to put in its place.
Seen downstream: an end-to-end acceptance run still needs a separate Compose stack with a Caddy in front (/api/*, /file/* → API, everything else → SPA, no buffering for a Server-Sent-Events stream), only because of this. Everything else (data = "fresh", workers, command + --run, skip, the lane's own ports) is already there.
Proposal
Path forwarding for a static service, settable in a profile like the other fields:
longest prefix wins; the path is passed on unchanged (a strip option could come later, cf. pathRewrite);
streaming responses are not buffered (SSE, chunked downloads), WebSocket upgrade passes through;
Host/X-Forwarded-* set as a reverse proxy would;
devstack check: forward only for static; targets resolve like other placeholders, so a target the profile skips is an error (as for env).
Alternatives
kind = "service" with run starting an own proxy (Caddy, a small Node server) in front of the build output. Works today, but every repository writes the same proxy again, and the stack file no longer says what the service is.
Absolute API URL in the build plus CORS on the API: changes the artifact under test and the API's configuration, so the run no longer tests what ships.
Activity
docs(changelog): a static service forwards paths (#551)