Skip to content

Express

Express is a fast, unopinionated, minimalist web framework for Node.js.

If you want to use Express with a fetch handler (like on Cloudflare, Netlify or Vercel), you will need to convert the Node handler to a fetch handler. We recommend srvx:

src/handler.ts
import type { ExportedHandler } from "@vite-deploy/netlify";
import express from "express";
import { toFetchHandler } from "srvx/node";
const app = express();
// ...
export default {
fetch: toFetchHandler(app),
} satisfies ExportedHandler;

Express is compatible out of the box with Node handlers:

src/handler.ts
import type { ExportedHandler } from "@vite-deploy/node";
import express from "express";
const app = express();
// ...
export default {
handler: app,
} satisfies ExportedHandler;