Codespaces: autostart, client preview, and SSR proxy-header fix - #14
Merged
Conversation
- Trust X-Forwarded-* headers in the Angular SSR server so it reconstructs the correct request URL behind the Codespaces proxy (fixes the 'trustProxyHeaders was not set up' warning). - Devcontainer: auto-open codespaces.md, open a preview for the Angular client (port 4200), and start the server/client on attach. - Add codespaces.md welcome guide shown when the project opens.
- Make forwarded ports (4200, 27017, 5300) public via the gh CLI. - Add a shebang and executable bit so postAttachCommand can run it directly.
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.
Summary
Makes the project run out-of-the-box in GitHub Codespaces and fixes an SSR warning behind the Codespaces proxy.
SSR proxy headers
{ trustProxyHeaders: true }toAngularNodeAppEngineinclient/server.ts. Codespaces terminates TLS at a trusted reverse proxy and forwards the original request viaX-Forwarded-*headers; without this, Angular v22 ignores them and logsReceived "x-forwarded-scheme" header but "trustProxyHeaders" was not set up to allow it.Devcontainer
codespaces.mdwhen the project opens.4200(onAutoForward: openPreview).postAttachCommand).Welcome guide
codespaces.md— a getting-started doc telling developers the app is already running (no install/start steps), with the forwarded ports, how to use the app, project layout, and optional seed/test commands.Notes
mean-stack-tutorial.md) is intentionally not included.postAttachCommandreferences.devcontainer/portSetup.sh, which is not present in the repo — worth adding or removing separately.