From c78574311bba4fd9deeaa109a8bf5e60c9b01e6e Mon Sep 17 00:00:00 2001 From: Srikanth <66662854+SrikanthKumarC@users.noreply.github.com> Date: Thu, 12 Jun 2025 00:57:38 +0530 Subject: [PATCH] docs(tanstack): migrate from createAPIFileRoute to createServerFileRoute (TanStack Start) (#2984) The `createAPIFileRoute` method is no longer available in the latest version of TanStack Start. This commit updates the codebase to use the new `createServerFileRoute` method for handling API routes, ensuring compatibility with the latest library version. --- docs/content/docs/installation.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/content/docs/installation.mdx b/docs/content/docs/installation.mdx index 75e37c54..d8bf56ae 100644 --- a/docs/content/docs/installation.mdx +++ b/docs/content/docs/installation.mdx @@ -374,15 +374,15 @@ Better Auth supports any backend framework with standard Request and Response ob ```ts title="src/routes/api/auth/$.ts" import { auth } from '~/lib/server/auth' - import { createAPIFileRoute } from '@tanstack/react-start/api' + import { createServerFileRoute } from '@tanstack/react-start/server' - export const APIRoute = createAPIFileRoute('/api/auth/$')({ - GET: ({ request }) => { - return auth.handler(request) - }, - POST: ({ request }) => { - return auth.handler(request) - }, + export const ServerRoute = createServerFileRoute('/api/auth/$').methods({ + GET: ({ request }) => { + return auth.handler(request) + }, + POST: ({ request }) => { + return auth.handler(request) + }, }); ```