feat: configurable base path via BASE_PATH env var#626
Open
4mgad wants to merge 13 commits intositeboon:mainfrom
Open
feat: configurable base path via BASE_PATH env var#6264mgad wants to merge 13 commits intositeboon:mainfrom
4mgad wants to merge 13 commits intositeboon:mainfrom
Conversation
Migrate all routes, asset references, and internal links from the hardcoded root path `/` to a configurable base path controlled by the BASE_PATH environment variable. Defaults to `/` when the variable is not set. What changed: - Introduced BASE_PATH env var to drive route prefix resolution - Updated all route definitions, static asset references, and internal links to resolve under the configured prefix - Set / as the default base path Why: - Enables the app to coexist behind a reverse proxy or within a larger platform without path collisions - Simplifies multi-tenant and namespace-isolated deployments - Eliminates the need for code changes when the hosting path shifts
feat: moving new session button higher
Syncing changes from the main repo
fix: update logo path to use BASE_PATH for better configurability
- Ensure BASE_PATH always has a leading slash even when set without one (e.g. BASE_PATH=cloudcli → /cloudcli) in both server and vite config - Namespace service worker cache by BASE_PATH to prevent collisions on shared origins; only purge own prefix caches during activation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…thout base path Add npm rebuild step after npm install --ignore-scripts so native addons (e.g. node-pty) compile during plugin install/update. Add plugin-ws WebSocket proxy to Vite dev config and handle plugin-ws paths without BASE_PATH prefix in the Express WS router for third-party plugin compat. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove --ignore-scripts from npm install so lifecycle scripts run (handles native addon compilation on all platforms). Remove the separate npm rebuild step (no longer needed). Add generic fixPrebuildPermissions() that scans all packages prebuilds for the current platform and ensures helper binaries are executable -- fixes node-pty spawn-helper permission bug on macOS and any similar issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
BASE_PATHenvironment variable (defaults to/)/→BASE_PATH/redirect is added automatically when a non-root base path is setDetails
BASE_PATHauthenticatedFetchauto-prefixes API calls; WebSocket URLs, logo assets, EventSource, and Router basename all derive fromimport.meta.env.BASE_URLself.locationBASE_PATHfrom env, setsbaseand proxy rules accordinglyTest plan
npm run devwithoutBASE_PATHset — app should work athttp://localhost:5173/(original behavior)BASE_PATH=/cloudcliin.env, restart dev server — app should work athttp://localhost:5173/cloudcli/npm startand verify production mode serves correctly under the configured prefixSummary by CodeRabbit