tanstack-start-api-routes
TanStack Start API Routes (Server Routes)
TanStack Start allows you to create API endpoints using the server property on routes. These run server-side and handle raw HTTP requests.
When to Use
- Building REST API endpoints
- Handling webhooks
- File uploads/downloads
- Any endpoint that returns data (not HTML)
Note: For RPC-style server logic callable from components, use server functions instead. Server routes are for traditional HTTP endpoints.
Basic Server Route
// src/routes/api/hello.ts
import { createFileRoute } from '@tanstack/react-router';
More from netlify/swar-templates
content-collections
Use content-collections for type-safe content management with markdown files. Use when building blogs, documentation sites, or any content-driven pages with frontmatter and markdown.
1tanstack-start-routes
Create and manage routes in TanStack Start using file-based routing. Use when adding new pages, configuring layouts, setting up nested routes, or working with route parameters.
1tanstack-start-loaders
Load data for TanStack Start routes using beforeLoad and loader functions. Use when fetching data for pages, implementing route guards, or setting up route context. IMPORTANT - Loaders should call server functions for data access.
1tanstack-start-project-setup
Set up and configure TanStack Start projects. Use when creating new projects, configuring the router, setting up TanStack Query integration, or configuring build settings.
1