Server Entry
Customize the server entry point:Server Functions
Configure how server functions are handled:Function ID Generation
By default, server functions receive auto-generated IDs. Customize this:Server Function Base Path
Server functions are served from a base path:Server Build Configuration
Configure server-side build options:Static NODE_ENV Replacement
WhenstaticNodeEnv is enabled (default), process.env.NODE_ENV is replaced with its actual value during build:
Development Server
Configure development server behavior:SSR Styles in Development
During development, CSS modules need special handling for SSR:Middleware Mode
Use TanStack Start as middleware in an existing server:Server Handler
Customize the request handler:Stream Handler
Use the default stream handler for SSR:Custom Response Headers
Add custom headers to all responses:Server-Only Code
Ensure code only runs on the server:Import Protection
Prevent server-only imports from leaking to the client:Prerendering
Configure static site generation:Page-Specific Prerender Options
Prerender Success Callback
Deployment Targets
Node.js Server
Default setup works for Node.js:Vercel
No additional configuration needed:Netlify
Use Netlify Edge Functions:Cloudflare Workers
Configure for Workers runtime:Docker
Example Dockerfile:Custom Server Environments
Create a custom server environment for edge deployments:Environment Variables
Load environment variables:PUBLIC_) are available on the client:
Performance Optimization
Response Caching
Compression
Enable response compression:Monitoring and Logging
Add request logging:Error Handling
Custom error responses:Next Steps
Server Functions
Learn how to create and use server functions
Deployment
Deploy your TanStack Start application