docs: use APIRoute instead of Route for tanstack start api routes (#943)

* fix(docs): use `APIRoute` instead of `Route` for tanstack start api routes

* fix(cli): remove unused import in drizzle schema
This commit is contained in:
Marc Mogdanz
2024-12-20 20:59:52 +03:00
committed by GitHub
parent cfd24bc5d5
commit 8dffaa2cd6
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -401,7 +401,7 @@ The server provides a `session` object that you can use to access the session da
import { auth } from "./auth";
import { createAPIFileRoute } from "@tanstack/start/api";
export const Route = createAPIFileRoute("/api/$")({
export const APIRoute = createAPIFileRoute("/api/$")({
GET: async ({ request }) => {
const session = await auth.api.getSession({
headers: request.headers
+1 -1
View File
@@ -363,7 +363,7 @@ Better Auth supports any backend framework with standard Request and Response ob
import { auth } from '~/lib/server/auth'
import { createAPIFileRoute } from '@tanstack/start/api'
export const Route = createAPIFileRoute('/api/auth/$')({
export const APIRoute = createAPIFileRoute('/api/auth/$')({
GET: ({ request }) => {
return auth.handler(request)
},
+1 -1
View File
@@ -16,7 +16,7 @@ Create a new file: `/app/routes/api/auth/$.ts`
import { auth } from '@/lib/auth'
import { createAPIFileRoute } from '@tanstack/start/api'
export const Route = createAPIFileRoute('/api/auth/$')({
export const APIRoute = createAPIFileRoute('/api/auth/$')({
GET: ({ request }) => {
return auth.handler(request)
},
@@ -1,7 +1,7 @@
import { createAPIFileRoute } from "@tanstack/start/api";
import { auth } from "~/lib/auth";
export const Route = createAPIFileRoute("/api/auth/$")({
export const APIRoute = createAPIFileRoute("/api/auth/$")({
GET: ({ request }) => {
return auth.handler(request);
},
@@ -1,4 +1,4 @@
import { pgTable, text, integer, timestamp, boolean } from "drizzle-orm/pg-core";
import { pgTable, text, timestamp, boolean } from "drizzle-orm/pg-core";
export const user = pgTable("user", {
id: text("id").primaryKey(),