Skip to content

Static sites and SPAs

Deploy a Static HTML site on Enzonic

A folder with an index.html is a site. Deploy serves it as is, from the root or from public/, dist/, build/, out/, _site/ or site/ if that is where index.html lives, with HTTPS, previews and rollbacks like any other project.

At a glance

What Enzonic Deploy does with a Static HTML project when you connect it. You can override any of it in the project settings.

Language
HTML, CSS, JavaScript
Detected from
index.html at the root, or in public/, dist/, build/, out/, _site/ or site/
Build command
None
Output
The folder that holds index.html
Runs as
Static

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

  • Static

    Always, plus functions for files in api/.

Deploy Static HTML step by step

  1. 1Upload the folder from the console or the CLI, or connect a repository.
  2. 2Deploy.
enzonic.json
{
  "cleanUrls": true,
  "headers": [
    { "source": "/assets/(.*)", "headers": [{ "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }] }
  ]
}

Connect a database to Static HTML

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.

api/contact.js
import pg from 'pg';

const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });

export async function POST(request) {
  const form = await request.formData();
  await pool.query('insert into messages (email, body) values ($1, $2)', [form.get('email'), form.get('body')]);
  return Response.redirect(new URL('/thanks.html', request.url), 303);
}
A contact form for a plain HTML site, stored in Postgres.

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 engine

Things to know

  • Dotfiles, package.json and enzonic.json are never served as static files.

Plan limits that matter here

From the live plan data. Every plan includes previews for each branch, instant rollback, environment variables and logs.

Plan limits that matter for Static HTML
LimitFreePro
Build minutes3,000/mo, 1 concurrent10,000/mo, 3 concurrent
Function memory / timeout1 GB / 300 s4 GB / 1800 s
Function invocations2 M/mo20 M/mo
Bandwidth150 GB/mo2 TB/mo

Compare every plan

Related guides

Ship your Static HTML project tonight

Connect the repository and the build settings fill themselves in. Free plan, no card.

Start free