build-web-service: fix ROOT_PATH placement and document URL handling#178
Open
gnguralnick wants to merge 1 commit into
Open
build-web-service: fix ROOT_PATH placement and document URL handling#178gnguralnick wants to merge 1 commit into
gnguralnick wants to merge 1 commit into
Conversation
The scaffolded services.toml command set ROOT_PATH at the front of `ROOT_PATH=... python3 scripts/forward_port.py ... && uv run <name>`, but a `VAR=val cmd1 && cmd2` prefix binds the variable to cmd1 only -- so it reached forward_port.py (which ignores it) while the app ran with ROOT_PATH unset and FastAPI's root_path empty. Move the assignment onto `uv run <name>`, and document the client-side half: URLs in the app's HTML/JS must be relative (an absolute path escapes to the workspace shell; a hardcoded prefix breaks standalone and on rename). Correct the previously-false gotchas claim that the scaffolded happy path emits prefix-correct URLs without further work. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7e6f126 to
e8bf3b1
Compare
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.
The scaffolded services.toml command set
ROOT_PATH=/service/<name>at the front ofROOT_PATH=... python3 scripts/forward_port.py ... && uv run <name>, but aVAR=val cmd1 && cmd2prefix binds the variable to cmd1 only -- so it reached forward_port.py (which ignores it) while the actual app ran with ROOT_PATH unset and FastAPI'sroot_pathempty. Every scaffolded service was therefore emitting non-prefixed server-side URLs (OpenAPI, redirects, url_for) despite the docs claiming otherwise. This moves the assignment ontouv run <name>and documents the other half of the problem -- client-side URLs in the app's HTML/JS must be relative (an absolute path escapes to the workspace shell; a hardcoded prefix breaks standalone and on rename) -- after hitting it live: a 'view raw' iframe with an absolutesrcloaded the workspace shell instead of the service route. The previously-false gotchas claim that the scaffolded happy path 'just works' is corrected.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com