Skip to content
Docs
Changelog

HTTP edges live in packages/api; web routes only mount

The files gateway, the MCP resource server, OAuth discovery, the RPC handler and the Better Auth handler moved behind request handlers in packages/api. Three web modules own server-side backend access, and a test keeps it that way.

Markdown

  • API routes are mounts. apps/web/src/routes/api/{rpc,files,mcp,auth} and the OAuth discovery routes under /.well-known are now a few lines each: they pass the request to a (request: Request) => Promise<Response> handler from @template-cloudflare/api/<feature>/http, as the billing and assistant routes already did. The session, membership, tenant and storage code they held is in packages/api (platform/rpc/http.ts, features/files/files.http.ts, features/mcp/mcp.http.ts, features/auth/auth.http.ts), under the backend's lint rules and next to its tests. No URL, status or header changed. (d8fa292)
  • Three web modules own backend access (W17). Only platform/rpc/orpc.ts, platform/auth/read-session.server.ts and server.ts value-import the router, auth, db or storage; 13 web files did before. scripts/web-feature-boundaries.test.mjs fails on any other importer. See web conventions.
  • A smaller package interface. @template-cloudflare/api no longer exports ./membership, ./uploads/service, ./documents/lifecycle-plugin and ./mcp/{server,context,protocol,guard}; nothing outside the package needs them now. A fork that imported one of them from its own web code moves that code into a <feature>.http.ts.
Edit on GitHubDocumentation is in English.
Cookie settings
We use essential cookies to make our app work. With your consent, we also use optional cookies to improve your experience.

Read our Cookie Policy and Privacy Policy.