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
- 1Upload the folder from the console or the CLI, or connect a repository.
- 2Deploy.
{
"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.
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);
}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
- 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.
| 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 Eleventy siteEleventy (11ty) sites built into _site.
- Deploy a Hugo siteHugo sites built with hugo --gc --minify, Hugo extended included.
- Deploy a Vite siteVite single-page apps with React, Vue, Svelte, Solid, Preact or Lit.
Ship your Static HTML project tonight
Connect the repository and the build settings fill themselves in. Free plan, no card.