@W-20784722@ Move envBasePath into ssrParameters#3590
Merged
vcua-mobify merged 8 commits intofeature/productize-path-prefixesfrom Jan 23, 2026
Merged
@W-20784722@ Move envBasePath into ssrParameters#3590vcua-mobify merged 8 commits intofeature/productize-path-prefixesfrom
vcua-mobify merged 8 commits intofeature/productize-path-prefixesfrom
Conversation
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
noahadams
reviewed
Jan 21, 2026
unandyala
reviewed
Jan 23, 2026
|
|
||
| // Load config to get envBasePath for local development | ||
| const config = getConfig() || {} | ||
| const envBasePath = config.ssrParameters?.envBasePath || '' |
Contributor
There was a problem hiding this comment.
can we add a comment describing why we need to read from ssrParameters only for local development
unandyala
approved these changes
Jan 23, 2026
Contributor
unandyala
left a comment
There was a problem hiding this comment.
Left couple of comments. overall LGTM
| apiKey: process.env.GOOGLE_CLOUD_API_KEY | ||
| } | ||
| }, | ||
| envBasePath: '/', |
Contributor
There was a problem hiding this comment.
Do we need the same default value in ssrParameters?
Contributor
Author
There was a problem hiding this comment.
No. The default value is for the envBasePath to be undefined so that it is not set on MRT or local.
Once it is defined, it must be a valid value (ie. /shop). The changes in this PR disallow setting envBasePath to just /
2c250bd
into
feature/productize-path-prefixes
42 checks passed
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.
This PR moves the experimental
envBasePathproperty from the config root into ssrParameters.This change allows us to send envBasePath to MRT as part of ssrParameters, thereby allowing MRT to consume and handle this path prefix.
This PR also updates existing files so that on both local and remote MRT environments:
envBasePathfrom the MRT_ENV_BASE_PATH system environment variable in nodeenvBasePathfrom window/path1/path2/path3)Additionally, this PR updates the default config + generator config templates.
Testing the changes:
In your config file, set
envBasePathto something like '/shop' or '/us' or '/test'Start the app
Verify that all express routes (ie. calls to /mobify/proxy or /mobify/bundle or /callback) use the envBasePath you have set
You can also check that window.MRT_ENV_BASE_PATH is set to what you have in the config file
Try setting an invalid base path. You should see an error on app start.
Starting the app without a base path works as normal.