Skip to content

Update from upstream#1521

Open
RyanJarv wants to merge 2 commits intoThinkmill:mainfrom
TheCavvy:main
Open

Update from upstream#1521
RyanJarv wants to merge 2 commits intoThinkmill:mainfrom
TheCavvy:main

Conversation

@RyanJarv
Copy link
Copy Markdown

No description provided.

RyanJarv and others added 2 commits March 15, 2026 21:18
Adds a `basePath` option to Keystatic's config that prefixes all UI and
API routes. This allows Keystatic to work correctly when hosted under a
subpath (e.g. Astro's `base: '/blog/'`).

When `basePath` is set:
- UI routes serve at `{basePath}/keystatic/` instead of `/keystatic/`
- API routes serve at `{basePath}/api/keystatic/` instead of `/api/keystatic/`
- OAuth redirect URIs include the prefix
- All internal redirects (login, logout, setup) respect the prefix

The change is fully backwards compatible — when `basePath` is not set,
all paths remain identical to the previous behavior.

Three shared utility functions (`getConfigBasePath`, `getKeystaticBasePath`,
`getKeystaticApiBasePath`) serve as the single source of truth, replacing
~30 hardcoded path references across the codebase.

Fixes: Thinkmill#1371

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add basePath config option for subpath deployments
@RyanJarv RyanJarv requested a review from emmatown as a code owner March 26, 2026 07:39
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 26, 2026

⚠️ No Changeset found

Latest commit: c771f6d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant