Configuration#
The site needs very little configuration. This page covers what exists, where it lives, and which parts you must not move into source control.
Before you start#
Complete Local setup first. Everything below assumes the development server runs.
Hosting bindings#
.openai/hosting.json declares whether a D1 database binding and an R2 bucket
binding are attached. The Vite configuration reads that file and attaches only
the bindings it names, so a site that needs neither runs with neither.
When a D1 binding is declared, local development uses a placeholder database identifier rather than a real one. That placeholder is a local development value only; it is not a production database and never becomes one.
The database layer#
The Drizzle schema at db/schema.ts is intentionally empty. The dependency and
the configuration are present so a table can be added when the site genuinely
needs one, and until then nothing is stored.
Adding a table means editing the schema and generating a migration:
npm run db:generate
Do not add a table to hold visitor data without deciding, first, what the privacy consequence is. An empty schema is the current, deliberate state.
Local tool state#
Three settings keep the development toolchain's state inside the project rather than in a shared user directory:
| Setting | Effect |
|---|---|
WRANGLER_WRITE_LOGS |
Disabled by default so routine runs do not accumulate logs |
WRANGLER_LOG_PATH |
Points at .wrangler/logs inside the project |
MINIFLARE_REGISTRY_PATH |
Points at .wrangler/registry inside the project |
These are non-secret tool settings and the repository sets them for you.
Application environment#
Application environment values belong in ignored .env* files, never in the
committed configuration. Nothing the site currently publishes requires one.
Do not put an API token, database URL or account identifier into
.openai/hosting.json, vite.config.ts, or any other tracked file. Those
files are committed.
Verify#
npm run devstarts without warning about a missing binding.git statusis clean after a development run — local state under.wrangler/is ignored.
If it does not work#
If the development server complains about an unknown binding, the name in
.openai/hosting.json and the name your code expects have diverged. Make them
match rather than adding a second binding.