skills/vercel-cli/references/node-backends.md
Vercel supports Node.js backend frameworks as first-class apps. Express and Hono are the most common, but Fastify, Elysia, NestJS, H3, and Koa are also supported. Your app is the entrypoint — not the api/ folder. No rewrites, no build scripts. Just export your app and deploy.
# Express
npm init -y && npm i express
# Create server.ts that exports default app
vc dev # local development
vc deploy # deploy
package.json dependenciesvercel.json rewrites neededVercel searches for these filenames (in order): app, index, server, main, src/app, src/index, src/server, src/main
With these extensions: .js, .cjs, .mjs, .ts, .cts, .mts
The preferred entrypoint filename is server.ts. The file must import the framework (import express from 'express', import { Hono } from 'hono', etc.).
We recommend using export default for the app instance, but calling .listen() also works.
my-app/
├── package.json
└── server.ts
package.json:
{
"type": "module",
"dependencies": {
"express": "5.1.0"
}
}
server.ts:
import express from 'express';
const app = express();
app.get('/', (_req, res) => {
res.send('Hello Express!');
});
export default app;
package.json:
{
"type": "module",
"dependencies": {
"hono": "^4.8.9"
}
}
server.ts:
import { Hono } from 'hono';
const app = new Hono();
app.get('/', c => {
return c.text('Hello Hono!');
});
export default app;
Run vc dev from the project root. Vercel runs your app directly with TypeScript support. No dev script is required, though you can add one if you prefer.
Static files in public/ are served automatically.
Most apps need zero configuration. Optional vercel.json settings:
{
"functions": {
"server.ts": {
"includeFiles": "views/**/*"
}
}
}
api/ folder: Your framework IS the app. Define routes in your app code, not as separate files in api/.vercel.json rewrites: Routes are introspected automatically from your app. Rewrites are not needed.build script: Vercel handles TypeScript compilation and bundling. Don't add a build script for transpilation — it's not needed and can cause issues.