> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.hyjal.cloud/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.hyjal.cloud/_mcp/server.

# Deploy a static site

> Build a Vite site and deploy it to Hyjal's static lane, from an empty terminal to a live HTTPS URL, in about five minutes.

This tutorial takes a Vite single-page application and deploys it to Hyjal on
the static lane. You end with a live HTTPS URL served by the platform's static
engine, with pre-compressed assets generated at deploy.

Time: about five minutes. You need the [`hyjal` CLI](/reference/cli) installed
and a logged-in session (`hyjal login`).

## 1. Create the site

Scaffold a Vite project. Any static output directory works; this tutorial uses
Vite's default `dist`.

```bash
$ npm create vite@latest acme-web -- --template vanilla
$ cd acme-web
$ npm install
```

Build once locally to confirm the output directory:

```bash
$ npm run build
vite v5.4.0 building for production...
✓ 14 modules transformed.
dist/index.html                 0.46 kB
dist/assets/index-D9x2.css      1.20 kB
dist/assets/index-8fA1.js      142.84 kB
✓ built in 412ms
```

The build wrote `dist/`. That is what Hyjal deploys.

## 2. Initialize the manifest

Run `hyjal init` from the project root. It detects the Vite build and writes a
starting [`hyjal.toml`](/deploy/hyjal-toml).

```bash
$ hyjal init
Detected: static site (build: npm run build, output: dist)
Wrote hyjal.toml
  project = acme
  resource.web  lane = static

Review hyjal.toml, then run: hyjal deploy
```

Open the generated manifest. It declares one Project, `acme`, with one
Resource, `web`, on the static lane:

```toml
[project]
name = "acme"

[resource.web]
lane = "static"
build = "npm run build"
output = "dist"
```

## 3. Enable SPA fallback

Vite's router serves every route from `index.html`. Set `spa = true` so unknown
paths rewrite to `index.html` instead of returning 404.

```toml
[resource.web]
lane = "static"
build = "npm run build"
output = "dist"
spa = true
```

## 4. Deploy

Run `hyjal deploy`. The CLI runs your build, uploads the output to the Project's
[Bucket](/data/buckets), generates brotli and gzip variants, and flips the route
atomically.

```bash
$ hyjal deploy
Building resource web (lane: static)...
  npm run build ✓
  compressing assets (brotli, gzip) ✓
Uploading artifact... digest sha256:1c9a4f…7be2
Applying policy... ✓
Flipping route... ✓

Deployed acme/web
  https://web--acme.hyjal.cloud
```

## 5. Open the live URL

```bash
$ hyjal open web
Opening https://web--acme.hyjal.cloud
```

The site is live. Because static assets carry no compile step, later
asset-only redeploys are near-instant.

## 6. Confirm the request in the logs

Stream logs and reload the page. Each request row carries method, path, status,
and latency.

```bash
$ hyjal logs -f --resource web
[14:02:11] GET  /                200   9ms
[14:02:11] GET  /assets/index-D9x2.css   200   3ms
[14:02:11] GET  /assets/index-8fA1.js    200   5ms
```

Press Ctrl-C to stop. The same timeline appears in the Console
[Logs tab](/observability/logs).

## What you built

* A Vite static site deployed to the `web` Resource on the static lane.
* A live URL at `https://web--acme.hyjal.cloud` with SPA fallback and
  pre-compressed assets.
* Request-correlated logs streaming to your terminal and the Console.

## Next steps

* Put it on your own domain: [Custom domain tutorial](/get-started/tutorials/custom-domain-tutorial)
* Add an API behind the front end: [Full-stack tutorial](/get-started/tutorials/full-stack-tutorial)
* Deploy on every git push: [Git push to deploy](/get-started/tutorials/git-push-deploy)