Switch to Fullstack
Fold a standalone backend back into the frontend in place - remount the API route, drop the cross-origin env, and deploy one unit.
Mount @repo/api inside the frontend again. Do it in place - re-running the CLI regenerates packages/config/src/index.ts and .env wholesale and overwrites your edits.
Choose fullstack to consolidate hosts, drop CORS and cross-origin env, or deploy to Vercel - only fullstack runs there, since separate + vercel is blocked.
Remount the API - recreate apps/web/app/api/[[...rest]]/route.ts:
import app from "@repo/api";
const handler = (req: Request) => app.fetch(req);
export const GET = handler;
export const POST = handler;
export const PUT = handler;
export const PATCH = handler;
export const DELETE = handler;
export const OPTIONS = handler;@repo/api - move "@repo/api": "workspace:*" from devDependencies to dependencies in apps/web/package.json, then pnpm install. The Hono runtime now ships with the frontend.NEXT_PUBLIC_API_URL to the frontend's own origin plus /api (http://localhost:3000/api in dev). Remove TRUSTED_ORIGINS and AUTH_COOKIE_DOMAIN - same-origin cookies return to lax.Request with no connection address, so the peer your standalone server read is gone and only platform detection can identify a caller. On a detected platform that is automatic; anywhere else every caller shares one rate-limit bucket and the 10/min sign-in limit applies to your whole app rather than per person. See Client IP.pnpm -F @repo/database run deploy) and DATABASE_URL onto the frontend's start / buildCommand.performanceMonitor.enabled: false in packages/config/src/index.ts. The framework already logs requests for the in-process mount.apps/backend and add --filter=!backend to the root dev script so pnpm dev no longer starts it. Leave it in the repo, dormant, so you can switch back.| Concern | Separate | Fullstack |
|---|---|---|
| API mount | apps/backend process | Frontend catch-all route |
@repo/api | devDependencies (types only) | dependencies |
NEXT_PUBLIC_API_URL | Backend origin | …/api (same origin) |
| DB schema step | Backend | Frontend |
| Cross-origin env | TRUSTED_ORIGINS, AUTH_COOKIE_DOMAIN | - |
Verify: run the frontend alone and confirm an authenticated browser call succeeds same-origin.
Switch to Separate
Move a fullstack project to a standalone backend in place - unmount the API route, repoint the client, and move DB ownership, with no CLI re-run.
Reverse Proxy
Front the node target's long-running apps with a proxy that routes by host and path, terminates TLS, strips the docs prefix, and forwards the client IP.