Skip to main content
Aero is static-first: pnpm build produces a plain dist/ you can deploy anywhere. When you need API routes, server-side logic, or deployment adapters, opt in to Nitro with a single config flag. Nitro wraps your built HTML — it does not replace Aero’s page compiler.
Enable Nitro only when you need it. Static sites have no server to manage or pay for.

Enable Nitro

Set server: true in your config:
aero.config.ts
Then add a nitro.config.ts at the project root:
nitro.config.ts

File conventions

Place server files under server/:

API handlers

Files in server/api/ are served at /api/.... The filename determines the route and HTTP method:
server/api/submit.post.ts
Use route parameters with [param] in the filename:
server/api/users/[id].ts

Preview after build

Use vp preview to serve the production build locally after vp build when Nitro is off or you used a static-only build (server: false, or vp build --mode static). That serves dist/ through Vite+ — no API routes. When server: true, vp build also writes .output/. Preview the full app (static + API from one origin) after build: Run both from the project root (where nitro.config.ts lives). The fullstack starter lists nitro as a devDependency so vpx nitro preview uses your pinned local version.

HTMX and Alpine.js

Aero works naturally with HTMX and Alpine.js for adding interactivity. Because Aero outputs plain HTML with no framework runtime, these libraries integrate without conflicts. Include them via <script> tags — no special configuration needed.

When to use server vs static