Switch to Fullstack
Fold a standalone backend back into the frontend - one deploy, no CORS, Vercel-ready.
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 + cross-origin env, or deploy to Vercel (only fullstack runs there - separate + vercel is blocked).
Remount the API: recreate apps/web-nuxt/server/api/[...paths].ts:
import app from "@repo/api";
export default defineEventHandler(async (event) => {
const req = toWebRequest(event);
return await app.fetch(req);
});Reinstall - run
pnpm install. @repo/api stays in apps/web-nuxt devDependencies; the catch-all route's static import is bundled into the server build by Nitro, so the Hono runtime ships with the frontend without a dependency move.Repoint the client - set
NUXT_PUBLIC_API_URL to the frontend's own origin + /api (http://localhost:3000/api dev). Remove TRUSTED_ORIGINS and AUTH_COOKIE_DOMAIN - same-origin cookies return to lax.Move DB ownership back - move the schema step (
pnpm -F @repo/database migrate) and DATABASE_URL onto the frontend's start/buildCommand.Stand down the backend - stop deploying
apps/backend. Leave it in the repo, dormant, so you can switch back.Deploy - one unit; Vercel now allowed. See Vercel.
| Concern | Separate | Fullstack |
|---|---|---|
| API mount | apps/backend process | frontend catch-all route |
@repo/api | devDependencies | devDependencies (the catch-all import is bundled by Nitro) |
NUXT_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.