Configuration
Configuration by example
Each config file ships beside an example file that lists every supported option, commented out with its default:
astro.config.mjs
astro.config.mjs.example
nitro.config.ts
nitro.config.ts.example
Changing a setting is uncommenting a line, not opening a documentation tab. The example file is never loaded — it’s a learning tool bundled with your exact version.
The site URL
The installer sets site in astro.config.mjs from your answer. Change it
whenever your origin changes: canonical URLs, Open Graph tags, the RSS feed and
sitemap output are all derived from it, and a feed full of links to the wrong
origin is worse than no feed.
Environment variables
| Variable | Default | What it does |
|---|---|---|
PUBLIC_API_BASE |
same origin | Base URL for the frontend’s preconfigured ofetch client (src/lib/api.ts) |
NITRO_LOG_LEVEL |
3 |
Server log level — 4 adds debug lines, 5 adds trace |
NITRO_UPSTREAM_URL |
httpbin demo | Where /api/upstream sends its outbound call |
ZN_API_PORT |
3000 |
Nitro dev port and the Astro proxy target, together |
All are read from .env; a value already in the environment wins over the
file, so a one-off override like NITRO_LOG_LEVEL=4 npm run dev works as
expected.
Nitro version
nitro is pinned to an exact beta. Don’t widen it to a caret range — the v3
beta still renames APIs between releases.
