From a6777321147aa26dbc8db8fdfeda441cb4f0fcc3 Mon Sep 17 00:00:00 2001 From: Maxwell <145994855+ping-maxwell@users.noreply.github.com> Date: Sat, 18 Oct 2025 01:46:17 +1000 Subject: [PATCH] docs: update tanstack installation example (#5379) --- docs/content/docs/installation.mdx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/content/docs/installation.mdx b/docs/content/docs/installation.mdx index d7ce2fe124..fe1adc3cea 100644 --- a/docs/content/docs/installation.mdx +++ b/docs/content/docs/installation.mdx @@ -403,17 +403,21 @@ Create a new file or route in your framework's designated catch-all route handle ```ts title="src/routes/api/auth/$.ts" - import { auth } from '~/lib/server/auth' - import { createServerFileRoute } from '@tanstack/react-start/server' + import { createFileRoute } from '@tanstack/react-router' + import { auth } from '@/lib/auth/auth' - export const ServerRoute = createServerFileRoute('/api/auth/$').methods({ - GET: ({ request }) => { - return auth.handler(request) + export const Route = createFileRoute('/api/auth/$')({ + server: { + handlers: { + GET: async ({ request }:{ request: Request }) => { + return await auth.handler(request) + }, + POST: async ({ request }:{ request: Request }) => { + return await auth.handler(request) + }, + }, }, - POST: ({ request }) => { - return auth.handler(request) - }, - }); + }) ```