# 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.

- **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](https://github.com/CarlosZiegler/template-cloudflare/commit/d8fa292880ef79774a4daf2e22b9b5d13515026d))
- **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](/docs/development/web-conventions#w17-routes-mount-the-backend-three-modules-own-backend-access).
- **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`.
