See vike.dev/vercel.
How to deploy:
- Fork this repository.
- Log in to your Vercel account (or create one).
- Add your fork on Vercel's dashbaord with following settings:
FRAMEWORK PRESET
should beVite
. (Vercel should automatically detect Vite; just make sure it's already set.)- Modify
Build and Output Settings
>OUTPUT DIRECTORY
fromdist
todist/client
.
That's it, your fork is now deployed on Vercel (it should look like vike-demo.vercel.app). It's continuously deployed: if you commit and push a change to your fork, then Vercel automatically re-deploys your app.
Integration points:
- API Route: api/ssr.js.
- Routing URLs to
api/ssr.js
: vercel.json#rewrites. - Development: the package.json's script
package.json#scripts.dev
; we use Vite's development server for improved DX.
👉 Vercel runs your API Route
api/ssr.js
as a serverless function, for more information see Vercel Docs > Serverless Functions > Deploying.