start-core/server-routes

Create and manage server-side API routes with TanStack Router.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/abereghici/skills --skill start-core-server-routes-abereghici
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: start-core/server-routes
Source: https://github.com/abereghici/skills/tree/main/vendor/tanstack-router/packages/start-client-core/skills/start-core/server-routes
Command: npx skills add https://github.com/abereghici/skills --skill start-core-server-routes-abereghici

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Centralize server-side API endpoints with app routes using TanStack Router, eliminating mismatches between UI and server logic.

Core Features & Use Cases

  • Unified routing model: Define API endpoints with server handlers via createFileRoute and expose GET, POST, PUT, and DELETE under a single file-based pattern.
  • Context-aware handlers: Access request, params, and per-route context to implement robust middleware and data handling.
  • Body parsing & responses: Parse request bodies and respond with consistent responses using standard helpers.

Quick Start

Define a server route for /api/hello in src/routes using createFileRoute and its server handlers.

Frequently Asked Questions about start-core/server-routes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create server-side API routes alongside UI routes in TanStack Start?

Server-side API routes in TanStack Start are created using the createFileRoute function to define file-based endpoints. This approach centralizes server logic alongside UI routes, exposing GET, POST, PUT, and DELETE handlers under a single unified routing pattern.

How does server route context work with TanStack Router request handling?

Server route context provides access to request data, URL params, and route-specific context within TanStack Router handlers. This mechanism enables robust per-handler middleware and data processing by passing contextual information directly into your API logic.

Can I apply per-handler middleware to file-based server routes in TanStack Start?

Yes, per-handler middleware can be applied to file-based server routes in TanStack Start. This allows you to intercept and process requests for specific handlers, managing data handling and access control before the main GET, POST, PUT, or DELETE logic executes.

What is the best way to parse request bodies and format responses in a TanStack Start backend?

The best way to parse request bodies and format responses in a TanStack Start backend is by using the standard helpers provided within the createFileRoute server handlers. These helpers ensure consistent body parsing and uniform response formatting across all API endpoints.

Does TanStack Start enforce file-based naming conventions for API server routes?

Yes, TanStack Start enforces file-based route naming conventions for API server routes. This requires defining endpoints within the route files, ensuring the server paths match the UI structure and eliminating mismatches between frontend and backend logic.