14.1 Static configuration
config App {
dbUrl: DbUrl
port: Port = DEFAULT_PORT
stripeKey: secret<str>
profile dev { dbUrl = "sqlite://dev.db" }
profile prod { port = 443 }
}
let app = App.get()config Name { … }declares a typed config. Fields are as indata;profile name { field = value }sets the values of a profile.- Sources in order of priority: the flag
--set App.port=8080→ the environment variableAPP_PORT(the config name and the field in UPPER_SNAKE_CASE, nesting through__) → the fileconfig/<profile>.toml→ theprofileblock → the default value. - The profile is selected by the flag
--profileorOXL_PROFILE;devby default. - The config is loaded at step 2 of start-up (§2.4). An unknown key, a wrong type, a refinement violation or a missing required field — a message naming the source and termination with exit code 78.
App.get()returnsArc<frozen App>; the value does not change until restart.constis for values known at build time and independent of the environment.
Related diagnostics
See also
Source: docs/spec/oxl-standard.en.md