Skip to content

fix: serve studio at /_studio in Vercel deployment instead of public root#1165

Closed
Claude wants to merge 1 commit intomainfrom
claude/deploy-studio-to-vercel-again
Closed

fix: serve studio at /_studio in Vercel deployment instead of public root#1165
Claude wants to merge 1 commit intomainfrom
claude/deploy-studio-to-vercel-again

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 16, 2026

在 Vercel 部署中,studio 应该运行在 /_studio 路径,而不是复制到 public 根目录。

Changes

Build script (apps/server/scripts/build-vercel.sh)

  • Copy studio dist to api/_studio/ instead of public/
  • Studio files now bundled with serverless function

Vercel configuration (apps/server/vercel.json)

  • Updated includeFiles to api/{node_modules,_studio}/**
  • Removed SPA fallback rewrite /((?!api/).*) → /index.html

Server entrypoint (apps/server/server/index.ts)

  • Added static file serving at /_studio path using serveStatic
  • Configured SPA fallback for studio routes

Architecture

Studio is now served as part of the serverless function at /_studio rather than as static files in public/. This keeps the deployment self-contained within the API function.

// Studio served at /_studio with SPA fallback
_app.get('/_studio/*', serveStatic({
    root: __dirname,
    rewriteRequestPath: (path) => path
}));

_app.get('/_studio/*', serveStatic({
    root: __dirname,
    rewriteRequestPath: () => '/_studio/index.html'
}));

- Modified build-vercel.sh to copy studio to api/_studio instead of public/
- Updated vercel.json to include api/_studio in includeFiles
- Configured static file serving at /_studio in server/index.ts
- Removed SPA rewrite from vercel.json

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/0d153df4-77aa-4de3-8c31-388b75929c38

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectstack-demo Error Error Apr 16, 2026 8:37am
spec Ready Ready Preview, Comment Apr 16, 2026 8:37am

Request Review

@hotlong hotlong closed this Apr 16, 2026
// Serve studio at /_studio
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const studioPath = join(__dirname, '_studio');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants