Skip to main content
zerotal

Documentation


Documentation / zerotal / config-reexport / AppConfig

Function: AppConfig()

AppConfig(options): AppConfigShape

Defined in: packages/core/src/config/AppConfig.ts:201

Build the application-level config with sensible defaults.

Pass overrides to customise any setting. Every field has a default that works out of the box so the minimum viable config is just AppConfig({}).

Parameters

options

Partial overrides; every field has a working default.

name?

string

env?

string

key?

string

debug?

boolean

url?

string

port?

number

locale?

string

timezone?

string

http3?

boolean

tls?

AppTlsConfig

maxRequestBodySize?

number

health?

boolean | HealthConfigShape

cors?

Partial<AppCorsConfig>

throttle?

Partial<AppThrottleConfig>

secureHeaders?

Partial<AppSecureHeadersConfig>

assets?

{ entrypoint: string | string[]; outDir?: string; prefix?: string; minify?: boolean; }

assets.entrypoint

string | string[]

assets.outDir?

string

assets.prefix?

string

assets.minify?

boolean

conventions?

{ enabled?: boolean; paths?: Partial<{ providers: string; middleware: string; models: string; observers: string; policies: string; listeners: string; events: string; jobs: string; schedules: string; validators: string; }>; }

conventions.enabled?

boolean

conventions.paths?

Partial<{ providers: string; middleware: string; models: string; observers: string; policies: string; listeners: string; events: string; jobs: string; schedules: string; validators: string; }>

Returns

AppConfigShape

The fully resolved AppConfigShape with defaults applied.

Example

// config/app.ts
import { AppConfig, env } from '@zerotal/core';

export default AppConfig({
  name: 'My App',
  url:  env('APP_URL', 'http://localhost:3000'),
});