Configuration & environment
Patties discovers configuration from a patties.config file in the project root, validates it through Zod, and loads environment variables and secrets before serving.
Config discovery
Patties discovers configuration from one of these files in the project root:
patties.config.tspatties.config.jspatties.config.mjs
You can also provide an explicit path with --config.
Authoring config
Use defineConfig() for a typed config object:
import { defineConfig } from "patties";
export default defineConfig({
target: "bun",
});
Current config fields
target:bunoredgeappDiroutDirpluginsenv.requiredenv.publicsecretsserver.portserver.hostnameserver.unixserver.reusePortadapter.bun.compile
Defaults
Important defaults include:
target: "bun"appDir: "./app"outDir: "./.patties"server.port: 3000server.hostname: "0.0.0.0"adapter.bun.compile: false
Validation
Config is parsed through Zod. Invalid values fail with a structured error that includes the offending path.
Environment and secrets
- required environment variables can be listed in
env.required - public environment keys can be listed in
env.public - secret keys can be listed in
secrets
During patties dev, Patties loads configured secrets and validates required environment variables before starting the server.