Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/start/framework/react/guide/server-entry-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,19 @@ The server entry point is where you can configure server-specific behavior:
- Logging and monitoring

This flexibility allows you to customize how your TanStack Start application handles server-side rendering while maintaining the framework's conventions.

## Configuring the Server Entry Point

When deploying to platforms like Cloudflare Workers or other edge runtimes, you need to configure where your custom server entry point is located.

### Cloudflare Workers

Update your `wrangler.jsonc` to point to your custom server entry point:

```jsonc
{
"main": "./src/server.ts"
}
```

This tells Cloudflare Workers to use your custom `src/server.ts` file as the entry point instead of the default TanStack Start handler. It is essential when you need custom middleware, authentication, or other server-side logic (such as i18n middleware for locale handling).
2 changes: 2 additions & 0 deletions examples/react/start-i18n-paraglide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export default {
}
```

> **Important**: A custom `server.ts` entry point is required for Paraglide to work correctly. It handles locale detection from URLs, server-side rendering context. See the [Server Entry Point documentation](https://tanstack.com/start/latest/docs/framework/react/guide/server-entry-point) for setup instructions on different platforms, including Cloudflare Workers.

In `__root.tsx` change the html lang attribute to the current locale.

```tsx
Expand Down