Skip to content

Deploy

You can deploy your frac App as a Node.js server on any compatible infrastructure provider, or to Cloudflare Workers via the nodejs_compat runtime.

Below are two common deployment targets. frac does not require a specific hosting provider; any platform that can run the server and expose /mcp over HTTPS can host your app.

frac runs on Cloudflare Workers via Wrangler and the nodejs_compat runtime. Static assets (your built views) are served by Cloudflare’s edge directly; the worker handles /mcp traffic and any other dynamic routes.

Add a wrangler.jsonc at your project root:

{
"name": "your-frac-app",
"main": "dist/server.js",
"compatibility_date": "2025-09-01",
"compatibility_flags": ["nodejs_compat"],
"assets": { "directory": "dist/assets" },
"define": {
"process.env.NODE_ENV": "\"production\""
}
}

Each setting is load-bearing:

  • compatibility_date >= 2025-09-01 + nodejs_compat — enables cloudflare:node’s httpServerHandler, which frac uses to bridge the Express app to the Workers fetch event.
  • assets.directory — points at the views built by frac build. Cloudflare serves these at the edge before requests reach your worker.
  • define.process.env.NODE_ENV — forces production mode even under wrangler dev. Without it, wrangler defaults to development locally and frac’s development tooling can be pulled into the worker bundle.
Terminal window
npm run build
npx wrangler deploy
Terminal window
pnpm build
pnpm dlx wrangler deploy
Terminal window
yarn build
yarn dlx wrangler deploy
Terminal window
bun run build
bunx wrangler deploy

wrangler dev runs your worker in workerd on your machine — the same runtime as production, not a Node.js fallback:

Terminal window
npm run build
npx wrangler dev
Terminal window
pnpm build
pnpm dlx wrangler dev
Terminal window
yarn build
yarn dlx wrangler dev
Terminal window
bun run build
bunx wrangler dev

Projects created with the frac scaffolder include a multi-stage Dockerfile so you can self-host on any container platform:

Terminal window
npm install
docker build -t my-app .
docker run -p 3000:3000 my-app
Terminal window
pnpm install
docker build -t my-app .
docker run -p 3000:3000 my-app
Terminal window
yarn install
docker build -t my-app .
docker run -p 3000:3000 my-app