start-server-routes
Documents the handler context ({ request, params, context, pathname, next }), dynamic ($id) and splat ($) params from the file name, per-handler middleware via createHandlers versus route-wide server.middleware, and how the same file can serve as both a UI route (component) and an API route (server) at once.
Critical rules: choose a server route over a server function when the endpoint must be callable from outside the app (webhooks, public REST, cross-origin) — see references/vs-server-functions.md for the decision; exactly one handler file may resolve to a given route path (routes/users.ts, routes/users/index.ts, and routes/users.index.ts all collide on /users); always await request.json()/.text()/.formData(); and handlers must return a Response (or Promise).
Includes a full REST-resource template with params and middleware.
Do NOT use this skill for internal type-safe RPC callable only from your own app (use start-server-functions), for reusable middleware chains (use start-middleware), or for UI route rendering.
TanStack Start Server Routes
Server routes are raw HTTP endpoints defined alongside app routes in
src/routes/. They use the server property on createFileRoute (imported
from @tanstack/react-router) and return standard Response objects. This skill
targets @tanstack/react-start v1.166.2.