API layer (Elysia)
HTTP API mounted at /api via Elysia on the App Router catch-all.
Location
src/app/(api)/api/[[...route]]/route.ts
Current routes
| Path | Role |
|---|---|
GET /api | Runtime versions health probe |
GET /api/search | Fumadocs search |
/api/auth/* | Better Auth handler (all methods) |
Rules
- Prefer server actions + use-cases for first-party UI mutations
- Use the Elysia app for webhooks, auth HTTP, search, and third-party callbacks
- Keep business rules out of route handlers — call modules / integrations
- Export
Apptype if you generate typed clients later
Adding a route
See Guides → Add an API route.