Vercel
Vercel has two standalone places you can mount a DaloyJS REST API handler — Node.js Functions and Edge Functions. Each target expects a slightly different export shape; the underlying app object is identical.
When to choose Vercel
- You want a standalone DaloyJS REST API on Vercel Functions.
- You want Fluid compute (the default since 2025) with per-request billing.
- You want preview deployments per PR with zero CI config.
Scaffold
The current Vercel starter creates an Edge Function REST API. If you prefer the Node.js runtime, use the toFetchHandler entrypoint shown below.
1. Vercel Node.js Functions (standalone API)
For a standalone DaloyJS REST API on the Node.js runtime, use a catch-all file in /api. Vercel Node.js Functions expect a default export with a fetch method.
2. Vercel Edge Functions (standalone API)
toEdgeHandler is still exported as a backward-compatible alias of toWebHandler; new code should prefer toWebHandler.
vercel.json
Most projects don't need vercel.json at all. Add it for per-function memory/duration limits or to pin a region.
The legacy builds property is deprecated — use functions instead.
Deploy
Storage
Vercel KV and Vercel Postgres no longer exist as Vercel-owned products. They were sunset in December 2024 and existing stores were migrated automatically — Vercel KV to Upstash Redis, Vercel Postgres to Neon. For new projects, add the equivalent integration from the Vercel Marketplace (Neon for Postgres, Upstash for Redis) — the integration provisions the store and injects the connection env vars into your project.
Vercel Blob and Edge Config are still first-party Vercel products. See Neon for the Postgres setup and distributed rate-limit store for the Redis setup.
Gotchas
- Edge runtime has no
node:*— keep middleware portable, and prefer fetch-based drivers (Neon serverless, PlanetScale, Turso) when running on Edge. - Standalone Vercel Node functions want a default export with
{ fetch }. UsetoFetchHandler. - Vercel sets
process.envon Node functions; on Edge, secrets are bundled at build time, so don't read them outside the handler.