Learn how to deploy your Bini.js application to production.
Bini.js can be deployed to any platform that supports Node.js, or exported as static files for static hosting. For all hosting platforms except static export, use the unified npm run deploy command.
Deployment Options
Platform
Command
Notes
Node.js Node.js
npm run deploy
Default — uses bini-server
GitHub Static Export
npm run export
GitHub Pages, S3, Firebase, Surge
Netlify Netlify
npm run deploy
Automated by bini-deploy
Vercel Vercel
npm run deploy
Automated by bini-deploy
Cloudflare Cloudflare
npm run deploy
Automated by bini-deploy
Deno Deno Deploy
npm run deploy
Automated by bini-deploy
Unified command:npm run deploy works for Node.js, Netlify, Vercel, Cloudflare, and Deno Deploy. Only static export uses npm run export.
⚡One Command to Deploy Anywhere
bini-deploy makes deployment effortless. Simply run:
npm run deploy
When you run npm run deploy, bini-deploy will:
Prompt you to choose your target platform: Web, Windows, macOS, Linux, Android, or iOS
If you choose Web, it prompts for hosting provider: Node.js (default), Netlify, Vercel, Cloudflare, or Deno Deploy
Automatically generates the platform-specific configuration files and entry points
Commits and pushes everything to your GitHub repository
This single command works for all hosting platforms with zero configuration needed:
Node.js — Builds and starts the server
Netlify — Automatically generates netlify.toml and edge function entry
Vercel — Automatically generates vercel.json and serverless function entry
Cloudflare — Automatically generates wrangler.toml and worker entry
Zero config required: bini-deploy automatically detects your project structure, picks the right adapter, and generates platform-specific configuration. No changes to vite.config.ts needed. Learn more at bini-deploy.
Node.jsNode.js Server
The default deployment option. Bini.js uses bini-server — a zero-dependency production server.
npm run deploy
Your app will be served at the port specified by PORT (default: 3000).
Platforms
Railway — Auto-detects Node.js, just connect your repo
Render — Set build command to npm run deploy and start to npm start
Fly.io — Use the Node.js builder
VPS — Use pm2 to keep the server running
bini-server features: ETag support, 30s timeouts, 10MB body limit, graceful shutdown, and automatic port increment.
NetlifyNetlify
Deploying to Netlify is completely automated with bini-deploy. No configuration needed.
npm run deploy
bini-deploy automatically generates:
netlify.toml — Build and edge function configuration
netlify/edge-functions/api.ts — API route handler for Edge Functions
Important: Netlify Edge Functions run on Deno, not Node.js. Node-specific packages like nodemailer, fs, or path will not work. Use Web API alternatives.
VercelVercel
Deploying to Vercel is completely automated with bini-deploy. No configuration needed.
npm run deploy
bini-deploy automatically generates:
vercel.json — Routing and build configuration
api/index.ts — Serverless function entry point
CloudflareCloudflare Workers
Deploying to Cloudflare Workers is completely automated with bini-deploy. No configuration needed.
npm run deploy
bini-deploy automatically generates:
wrangler.toml — Worker configuration
worker.ts — Worker entry point with API routes
Or deploy manually with Wrangler:
npx wrangler deploy
DenoDeno Deploy
Deploying to Deno Deploy is completely automated with bini-deploy. No configuration needed.
npm run deploy
bini-deploy automatically generates:
server/index.ts — Deno Deploy entry point
In the Deno Deploy dashboard, set:
Entrypoint:server/index.ts
Build Command:npm run deploy
Runtime: Dynamic App
GitHubStatic Export
For static hosting, export your app as HTML files (this is the only deployment method that doesn't use npm run deploy):
npm run export
The exported files will be in the dist/ folder. Suitable for:
GitHub Pages
Amazon S3
Firebase Hosting
Cloudflare Pages (static mode)
Netlify (static mode)
Vercel (static mode)
GitHub Pages
Set the base option in vite.config.ts if deploying to a subpath:
Learn how to deploy your Bini.js application to production.
Bini.js can be deployed to any platform that supports Node.js, or exported as static files for static hosting. For all hosting platforms except static export, use the unified npm run deploy command.
Deployment Options
Platform
Command
Notes
Node.js Node.js
npm run deploy
Default — uses bini-server
GitHub Static Export
npm run export
GitHub Pages, S3, Firebase, Surge
Netlify Netlify
npm run deploy
Automated by bini-deploy
Vercel Vercel
npm run deploy
Automated by bini-deploy
Cloudflare Cloudflare
npm run deploy
Automated by bini-deploy
Deno Deno Deploy
npm run deploy
Automated by bini-deploy
Unified command:npm run deploy works for Node.js, Netlify, Vercel, Cloudflare, and Deno Deploy. Only static export uses npm run export.
⚡One Command to Deploy Anywhere
bini-deploy makes deployment effortless. Simply run:
npm run deploy
When you run npm run deploy, bini-deploy will:
Prompt you to choose your target platform: Web, Windows, macOS, Linux, Android, or iOS
If you choose Web, it prompts for hosting provider: Node.js (default), Netlify, Vercel, Cloudflare, or Deno Deploy
Automatically generates the platform-specific configuration files and entry points
Commits and pushes everything to your GitHub repository
This single command works for all hosting platforms with zero configuration needed:
Node.js — Builds and starts the server
Netlify — Automatically generates netlify.toml and edge function entry
Vercel — Automatically generates vercel.json and serverless function entry
Cloudflare — Automatically generates wrangler.toml and worker entry
Zero config required: bini-deploy automatically detects your project structure, picks the right adapter, and generates platform-specific configuration. No changes to vite.config.ts needed. Learn more at bini-deploy.
Node.jsNode.js Server
The default deployment option. Bini.js uses bini-server — a zero-dependency production server.
npm run deploy
Your app will be served at the port specified by PORT (default: 3000).
Platforms
Railway — Auto-detects Node.js, just connect your repo
Render — Set build command to npm run deploy and start to npm start
Fly.io — Use the Node.js builder
VPS — Use pm2 to keep the server running
bini-server features: ETag support, 30s timeouts, 10MB body limit, graceful shutdown, and automatic port increment.
NetlifyNetlify
Deploying to Netlify is completely automated with bini-deploy. No configuration needed.
npm run deploy
bini-deploy automatically generates:
netlify.toml — Build and edge function configuration
netlify/edge-functions/api.ts — API route handler for Edge Functions
Important: Netlify Edge Functions run on Deno, not Node.js. Node-specific packages like nodemailer, fs, or path will not work. Use Web API alternatives.
VercelVercel
Deploying to Vercel is completely automated with bini-deploy. No configuration needed.
npm run deploy
bini-deploy automatically generates:
vercel.json — Routing and build configuration
api/index.ts — Serverless function entry point
CloudflareCloudflare Workers
Deploying to Cloudflare Workers is completely automated with bini-deploy. No configuration needed.
npm run deploy
bini-deploy automatically generates:
wrangler.toml — Worker configuration
worker.ts — Worker entry point with API routes
Or deploy manually with Wrangler:
npx wrangler deploy
DenoDeno Deploy
Deploying to Deno Deploy is completely automated with bini-deploy. No configuration needed.
npm run deploy
bini-deploy automatically generates:
server/index.ts — Deno Deploy entry point
In the Deno Deploy dashboard, set:
Entrypoint:server/index.ts
Build Command:npm run deploy
Runtime: Dynamic App
GitHubStatic Export
For static hosting, export your app as HTML files (this is the only deployment method that doesn't use npm run deploy):
npm run export
The exported files will be in the dist/ folder. Suitable for:
GitHub Pages
Amazon S3
Firebase Hosting
Cloudflare Pages (static mode)
Netlify (static mode)
Vercel (static mode)
GitHub Pages
Set the base option in vite.config.ts if deploying to a subpath: