Search forkrail

Search documentation, comparisons, and CLI commands.

Websites & full-stack
Production ready

Deploy Vite & static SPAs on forkrail

Zero Lambda functions, zero cold starts. forkrail builds dist/, stores assets by content hash in S3 across your active regions, and serves them directly from the regional Rust routers.

Adapter
None (auto-detects dist/)
Runtime
Static S3 (no Lambda · optional api/ functions)
Detection
package.json (vite)
Memory
None (static delivery only)
  • Zero-Lambda serving
    Served from router memory cache and regional S3 buckets
  • SPA fallback rewrites
    Standard vercel.json catch-all rewrite to /index.html
  • Functions in api/
    Add Node, Python, Go, or Rust endpoints beside your SPA
  • Routing middleware
    Optional root middleware.ts for auth, geo, or A/B routing

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:

vercel.json
{
"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).

Set build env vars and deploy
printf 'https://api.acme.dev' | forkrail env add web-spa VITE_API_URL --target production
forkrail deploy --prod

3. 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/.

Ready to deploy your Vite project inside your own AWS account?
Quickstart