mirror of
https://github.com/supabase/supabase.git
synced 2026-09-06 18:11:51 +08:00
**Stack 4/6** of the TanStack Start migration (#46424). Stacked on **#47112** (S3). > [!NOTE] > Mechanical and homogeneous — every file is the same shape: a `createFileRoute(...)` whose `server.handlers` delegate to the existing `pages/api` handler via `toWebHandler` (the compat shim from S2). The pages-router handlers are unchanged; Next still serves them directly and ignores `routes/`. ## What's in this PR - `routes/api/**` (~104 files): platform (`pg-meta`, auth, storage, integrations, profile, telemetry, organizations, projects…), `ai/*`, `v1/*`, `connect`, `content`/`mcp`, and standalone endpoints (`deployment-mode`, `get-ip-address`, etc.). - `routeTree.gen.ts` — **regenerated** for the routes present so far (root + auth/app + api). ## Review tip The route files are near-identical wrappers, so this is fast to skim. The generated `routeTree.gen.ts` isn't meaningful review surface. ## Verification On top of S1–S3: `studio` typecheck ✓, lint (0 errors) ✓. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Model Context Protocol (MCP) API endpoint with configurable feature support and read-only mode * Added function artifact streaming capability for self-hosted functions * **Chores** * Migrated API route infrastructure for improved system architecture <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
16 lines
498 B
TypeScript
16 lines
498 B
TypeScript
import { createFileRoute } from '@tanstack/react-router'
|
|
import type { NextRequest } from 'next/server'
|
|
|
|
// docs.ts is already Web-native (Next edge runtime): takes `NextRequest`,
|
|
// returns `Response`, and streams SSE back from OpenAI. Direct re-export —
|
|
// no shim buffering needed.
|
|
import docsHandler from '@/pages/api/ai/docs'
|
|
|
|
export const Route = createFileRoute('/api/ai/docs')({
|
|
server: {
|
|
handlers: {
|
|
POST: ({ request }) => docsHandler(request as NextRequest),
|
|
},
|
|
},
|
|
})
|