Deploying
The Velz server is written against the Web Fetch API, so the same build runs on every runtime that speaks it. There is no adapter to configure.
Cloudflare Workers
import { handler } from './dist/server/index.js'
export default {
fetch: (request, env, ctx) => handler(request),
}Point the worker at dist/server and the assets binding at dist/client. The static assets are served first, the handler answers everything else.
Vercel and other Node hosts
import { handler } from './dist/server/index.js'
import { startNodeServer } from '@veyra-labs/velz/adapters/node'
startNodeServer(handler, { port: process.env.PORT ?? 3000 })Static hosting
A site with no API routes and no dynamic data can be prerendered. Point your host at dist/client and every route is a file.
What the build produces
dist/clientholds the browser bundle, the CSS and any static assets.dist/serverholds the request handler as a single module with no runtime dependencies.dist/velz-assets.jsonmaps the two together, so the server knows which script and stylesheet to reference.