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 build
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. Static export uses npm run build which pre-renders all routes.
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
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
GitHubStatic Export
For static hosting, npm run build pre-renders every route to static HTML. This is the only deployment method that doesn't use npm run deploy.
npm run build
The pre-rendered 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:
Pre-rendering:npm run build pre-renders all static routes to HTML and creates shell pages for dynamic routes. The client hydrates on load. No separate export command needed.
Platform Comparison
Platform
API Runtime
Static Routes
Dynamic Routes
Deploy Command
Node.js Node.js
Node.js
npm run deploy
Netlify Netlify
Deno (Edge)
npm run deploy
Vercel Vercel
Edge
npm run deploy
Cloudflare Cloudflare
Workers
npm run deploy
Deno Deno Deploy
Deno
npm run deploy
GitHub Static Export
N/A
via shell pages
npm run build
Environment Variables in Production
Set environment variables through your hosting platform's dashboard:
Platform
How to Set
Node.js Node.js
Use .env file or system environment variables
Netlify Netlify
Site settings → Environment variables
Vercel Vercel
Project settings → Environment Variables
Cloudflare Cloudflare
wrangler.toml or dashboard
Deno Deno Deploy
Project settings → Environment Variables
Never commit .env files with secrets to your repository. Use platform environment variables for production.
Best Practices
Test builds locally — Run npm run build and npm run preview before deploying.
Use environment variables — Keep configuration separate from code.
Set up CI/CD — Automate deployments with GitHub Actions or similar.
Monitor your app — Use platform analytics to track performance.
Use a custom domain — Configure SSL for secure connections.
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 build
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. Static export uses npm run build which pre-renders all routes.
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
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
GitHubStatic Export
For static hosting, npm run build pre-renders every route to static HTML. This is the only deployment method that doesn't use npm run deploy.
npm run build
The pre-rendered 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:
Pre-rendering:npm run build pre-renders all static routes to HTML and creates shell pages for dynamic routes. The client hydrates on load. No separate export command needed.
Platform Comparison
Platform
API Runtime
Static Routes
Dynamic Routes
Deploy Command
Node.js Node.js
Node.js
npm run deploy
Netlify Netlify
Deno (Edge)
npm run deploy
Vercel Vercel
Edge
npm run deploy
Cloudflare Cloudflare
Workers
npm run deploy
Deno Deno Deploy
Deno
npm run deploy
GitHub Static Export
N/A
via shell pages
npm run build
Environment Variables in Production
Set environment variables through your hosting platform's dashboard:
Platform
How to Set
Node.js Node.js
Use .env file or system environment variables
Netlify Netlify
Site settings → Environment variables
Vercel Vercel
Project settings → Environment Variables
Cloudflare Cloudflare
wrangler.toml or dashboard
Deno Deno Deploy
Project settings → Environment Variables
Never commit .env files with secrets to your repository. Use platform environment variables for production.
Best Practices
Test builds locally — Run npm run build and npm run preview before deploying.
Use environment variables — Keep configuration separate from code.
Set up CI/CD — Automate deployments with GitHub Actions or similar.
Monitor your app — Use platform analytics to track performance.
Use a custom domain — Configure SSL for secure connections.