bri.config
Two layers into one plain map: conf.edn → APP_* env. No config classes, no watchers, no remote sources.
(def cfg (config/load!)) ; reads a file (and the env), no more(:port cfg) ; a plain map — get/get-in like any otherThis is the cfg you saw on the golden page in the tutorial: a top-level def that constructs a value, with no other I/O.
conf.edn and profiles
Section titled “conf.edn and profiles”Profiles are a :profiles section, not a file family:
{:port 3000 :db {:host "localhost" :pool-size 5} :profiles {:dev {} :test {:db {:host "test-db"}}}}APP_PROFILE selects the overlay (default dev; cljgo dev sets dev, cljgo test sets test). The selected profile deep-merges over the base map.
Environment overlay
Section titled “Environment overlay”APP_* variables win over the file. The mapping is deterministic: __ (double underscore) separates path segments, single _ joins words —
APP_PORT=8080 → [:port]APP_DB__POOL_SIZE=9 → [:db :pool-size]Values coerce: all-digit → integer, true/false → boolean, else string. Durations and sizes are numbers (seconds, bytes) — no stringly-typed "5m".
The schema (optional, enforced when present)
Section titled “The schema (optional, enforced when present)”conf.schema.edn — generated minimal by cljgo new --template web, delete it to go schemaless:
{[:port] {:type :int :required true :default 3000}}:defaultis the lowest layer (file, profile, and env all beat it).:requiredmissing from every layer →load!throws before any server/pool/worker starts, naming the key. Misconfigured deploys must not boot.:type(:int :number :string :boolean :keyword) mismatches name the key and the layer that supplied the bad value.
2 a.m. debugging
Section titled “2 a.m. debugging”$ cljgo configprofile: dev [:db :host] "localhost" <- file [:db :pool-size] 9 <- env [:port] 3000 <- fileEvery key, its effective value, and the layer that won (default < file < profile < env).
Questions or feedback on this page? Comment below with your GitHub account — comments are public and live in the project's GitHub Discussions.