Deploy to Node and Vercel
Node server
npm ci
npm run build
HOST=0.0.0.0 PORT=3278 npm startnpm ci when the project already has a package-lock.json; the generator creates it with --install. Otherwise run npm install first and commit the lockfile.
dist/server, dist/client and dist/prerender.json structure with installed runtime dependencies; do not copy only index.js. The server serves assets and prerendered URLs from the client directory.
HOST=0.0.0.0 makes the process reachable on the machine's interfaces, useful behind a reverse proxy or in a container. Configure TLS, the domain and process restarts through your hosting platform. On SIGTERM, the server closes Fastify.
Vercel
vercel.json. Import the repository into Vercel with these settings.
npm run build:vercel | |
npm run build:vercel.vercel/output in the Build Output API format. Do not upload these files to a public website root or set dist/client as the output: the root template must remain private to the SSR renderer.
Rendering and functions
vercel: { functions: 'routes' }: the adapter creates dedicated page and endpoint functions plus fallbacks. Static files and prerendered pages use the CDN. Functions reuse Fastify initialization between warm invocations without starting a TCP listener.
VITE_ variables for secrets. This alpha does not implement ISR or shared SSR HTML caching.
Verify the result
/, /greet/world, /api/health, /about and an unknown URL. Also try the counter and browser navigation. A successful build does not replace checking the actual deployment.