Skip to content

Add injectable public base path for hosted wrappers#86

Merged
benvinegar merged 8 commits into
mainfrom
hosted-wrapping-seams
Jun 20, 2026
Merged

Add injectable public base path for hosted wrappers#86
benvinegar merged 8 commits into
mainfrom
hosted-wrapping-seams

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

Adds optional public base-path support so hosted wrappers can mount sideshow under a prefix such as /u/:account while preserving the core app’s internal route shape.

When basePath is unset, self-hosted behavior is unchanged.

What changed

  • Adds createApp({ basePath }), accepting a string or request-aware hook.
  • Injects window.__SIDESHOW_BASE_PATH__ into the viewer.
  • Viewer API calls, iframe URLs, copied/opened surface links, and HTTP MCP returned URLs use the configured base path.
  • Keeps /s/:id?part=N as the html-part iframe endpoint.
  • In hosted/basePath mode, /s/:id without part redirects to BASE_PATH/?surface=:id so markdown/diff/etc. surfaces open in the full viewer.
  • Leaves default self-hosted /s/:id behavior unchanged when basePath is unset.

Validation

npm run typecheck
npm run build

Also validated from the hosted wrapper repo:

npm run typecheck
npm test
npm run build

This PR description was generated by Pi using OpenAI GPT-5.1

Comment thread server/app.ts Fixed
@benvinegar benvinegar force-pushed the hosted-wrapping-seams branch from a30a304 to d9de1ae Compare June 20, 2026 20:38
@benvinegar benvinegar merged commit 91db9a3 into main Jun 20, 2026
9 checks passed
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.

2 participants