Skip to content

[SLOP(claude-opus-4-8)] fix(kitchen-sink): serve built frontend from server#5306

Open
MasterPtato wants to merge 1 commit into
mainfrom
stack/slop-claude-opus-4-8-fix-kitchen-sink-serve-built-frontend-from-server-rymmurrk
Open

[SLOP(claude-opus-4-8)] fix(kitchen-sink): serve built frontend from server#5306
MasterPtato wants to merge 1 commit into
mainfrom
stack/slop-claude-opus-4-8-fix-kitchen-sink-serve-built-frontend-from-server-rymmurrk

Conversation

@MasterPtato

@MasterPtato MasterPtato commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@MasterPtato

MasterPtato commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Stack for rivet-dev/rivet

Get stack: forklift get 5306
Push local edits: forklift submit
Merge when ready: forklift merge 5306

@railway-app

railway-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

🚅 Deployed to the rivet-pr-5306 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-cloud 😴 Sleeping (View Logs) Web Jun 24, 2026 at 8:48 am
website 😴 Sleeping (View Logs) Web Jun 23, 2026 at 8:35 pm
kitchen-sink 😴 Sleeping (View Logs) Web Jun 20, 2026 at 10:32 pm
frontend-inspector 😴 Sleeping (View Logs) Web Jun 20, 2026 at 9:21 pm
ladle ✅ Success (View Logs) Web Jun 19, 2026 at 1:08 am
mcp-hub ✅ Success (View Logs) Web Jun 19, 2026 at 1:05 am

@claude

claude Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Code Review

Small, focused change that adds built-frontend serving to the kitchen-sink example. The approach is sound.

Observations

Hono path accessnew URL(c.req.url).pathname allocates a full URL object just to get the path. Hono exposes c.req.path directly, which avoids the overhead:

// current
const path = new URL(c.req.url).pathname;
const last = path.slice(path.lastIndexOf('/') + 1);

// simpler
const last = c.req.path.split('/').at(-1) ?? '';

Minor, but worth fixing since this runs on every unmatched request.

Extension heuristiclast.includes('.') catches most asset paths but would incorrectly 404 on paths like /v1.0/feature. A tighter check for known static extensions or checking whether serveStatic already returned a non-404 would be more robust. Probably acceptable for a kitchen-sink example, but worth noting.

Comment style — The opening block comment explains what the code does rather than why (per CLAUDE.md: "Do not explain WHAT the code does"). The non-obvious constraint worth keeping is that dist/ only exists in production images:

// dist/ only exists in production images; dev runs skip this block.

Route ordering looks correct — static middleware is registered after all /api/rivet and debug routes, so there is no risk of intercepting API traffic.

readFileSync at startup — reading index.html once at startup is the right call for a long-lived process.

Overall this is a clean, minimal addition. The c.req.path nit is the only real improvement worth applying before merging.

@MasterPtato MasterPtato force-pushed the stack/slop-claude-opus-4-8-fix-kitchen-sink-serve-built-frontend-from-server-rymmurrk branch from 051f338 to 6efb5f5 Compare June 23, 2026 20:22
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