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

change rymmurrk

@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)
website 😴 Sleeping (View Logs) Web Aug 8, 2026 at 7:57 pm
frontend-cloud 😴 Sleeping (View Logs) Web Aug 8, 2026 at 7:51 pm
frontend-inspector 😴 Sleeping (View Logs) Web Aug 8, 2026 at 7:27 am
kitchen-sink 😴 Sleeping (View Logs) Web Aug 8, 2026 at 7:25 am
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; route ordering is correct so /api/rivet and the debug routes still take precedence in serverless modes.

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:

// 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 produced a response, would be more robust. Probably acceptable for a kitchen-sink example.

serverful mode masks a stray-request 404 — the new catch-all is unconditional on mode. In serverful mode, /api/rivet/* never gets a route registered (see the comment above the if (mode === "serverful") block: stray hits there are considered unwanted). Before this change such a request 404d; now it falls through the static middleware (no match) into the SPA app.get("/*", ...) handler and returns a 200 with index.html instead. Low impact for an example app, but worth a conscious call, either scope the SPA fallback to non-serverful modes or note that this is intentional.

Comment style — the opening block comment explains what the code does rather than why (per CLAUDE.md: do not explain what the code does when it is already obvious from reading it). The one non-obvious fact worth keeping is that dist/ only exists in production images:

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

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

Overall this is a clean, minimal addition. The c.req.path nit and the serverful-mode fallback behavior are the two things worth a second look before merging.

@MasterPtato
MasterPtato force-pushed the stack/slop-claude-opus-4-8-fix-kitchen-sink-serve-built-frontend-from-server-rymmurrk branch from c8f4673 to 051f338 Compare June 22, 2026 22:41
@railway-app
railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-5306 June 22, 2026 22:41 Destroyed
@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
@NathanFlurry NathanFlurry changed the title [SLOP(claude-opus-4-8)] fix(kitchen-sink): serve built frontend from server fix(kitchen-sink): serve built frontend from server Jun 26, 2026
@MasterPtato
MasterPtato force-pushed the stack/slop-claude-opus-4-8-fix-kitchen-sink-serve-built-frontend-from-server-rymmurrk branch from 6efb5f5 to 0caa600 Compare August 7, 2026 01:27
@MasterPtato MasterPtato changed the title fix(kitchen-sink): serve built frontend from server [SLOP(claude-opus-4-8)] fix(kitchen-sink): serve built frontend from server Aug 7, 2026
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