Node.js and Bun backends
Deploy a Node.js functions app on Enzonic
Put .js or .ts files in api/ and each one becomes an endpoint at /api/<file>. Functions start on demand, stay warm for a few minutes and scale with traffic, so you pay nothing in idle time. The same api/ folder also works next to any static framework.
At a glance
What Enzonic Deploy does with a Node.js functions project when you connect it. You can override any of it in the project settings.
- Language
- JavaScript / TypeScript
- Detected from
- Files in api/*.js or api/*.ts, with no server framework entry point
- Build command
- None by default
- Output
- api/ plus public/ for static files
- Runs as
- Functions
Dependencies install with the package manager your lockfile names: npm ci, pnpm install --frozen-lockfile, yarn install --immutable (Berry) or --frozen-lockfile, or bun install --frozen-lockfile. Node.js 18, 20, 22 and 24 are available. Deploy reads engines.node in package.json, then .nvmrc or .node-version, and uses Node.js 22 when nothing pins a version.
How it runs
Functions
Always. Instances stay warm for 5 minutes on Free and 15 minutes on paid plans after a request.
Deploy Node.js functions step by step
- 1Create api/hello.ts exporting a GET function.
- 2Optionally add public/ for static files.
- 3Connect the repository and deploy.
export function GET(request: Request) {
const name = new URL(request.url).searchParams.get('name') ?? 'world';
return Response.json({ hello: name });
}Connect a database to Node.js functions
Create a database on Enzonic Databases (or from the project's settings) and its connection string is added to the project's environment variables. This example uses PostgreSQL.
import postgres from 'postgres';
// Created once per warm instance and reused across requests.
const sql = postgres(process.env.DATABASE_URL!, { max: 1 });
export async function GET() {
return Response.json(await sql`select id, name from users limit 50`);
}Postgres projects get two variables: DATABASE_URL through the connection pooler for the app, and DATABASE_URL_UNPOOLED for migrations.
PostgreSQL on Enzonic DatabasesEvery database engineThings to know
- Function memory and maximum duration come from your plan; long jobs belong in a server project.
- Keep a small connection pool per instance (max: 1 or 2): many warm instances share one database.
Plan limits that matter here
From the live plan data. Every plan includes previews for each branch, instant rollback, environment variables and logs.
| Limit | Free | Pro |
|---|---|---|
| Build minutes | 3,000/mo, 1 concurrent | 10,000/mo, 3 concurrent |
| Function memory / timeout | 1 GB / 300 s | 4 GB / 1800 s |
| Function invocations | 2 M/mo | 20 M/mo |
| Bandwidth | 150 GB/mo | 2 TB/mo |
Related guides
- Deploy a Node.js appAny Node.js server with a start script: bots, WebSocket servers, workers with an HTTP port.
- Deploy a Vite siteVite single-page apps with React, Vue, Svelte, Solid, Preact or Lit.
- Deploy a Python functions appPlain Python handlers in api/*.py, no framework needed.
Ship your Node.js functions project tonight
Connect the repository and the build settings fill themselves in. Free plan, no card.