1. Configure SPA routing (optional)
forkrail runs your build script and deploys dist/ automatically (or any custom outputDirectory in vercel.json). For client-side routed single-page apps (React, Vue, Solid, Preact), add a catch-all rewrite to /index.html, just like on Vercel:
{ "rewrites": [ { "source": "/(.*)", "destination": "/index.html" } ], "headers": [ { "source": "/assets/(.*)", "headers": [ { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" } ] } ]}2. Deploy & set VITE_* build variables
Any environment variable added to the project is available during vite build (so import.meta.env.VITE_* embeds cleanly per environment — Preview vs Production).
printf 'https://api.acme.dev' | forkrail env add web-spa VITE_API_URL --target productionforkrail deploy --prod3. Add backend endpoints in api/
Need a few backend endpoints without standing up a separate service? Drop files in api/ (for example api/contact.ts or api/checkout.ts) and forkrail serves /api/* alongside your Vite static files. See Functions in api/.