Settings reference
Everything under src/settings/ is loaded into moxie.settings (directly or indirectly) and drives routing, upstream URLs, cache headers, and response spec headers.
Directory overview
src/settings/
├── routes/ # URL routing: per-site + shared
│ ├── sites/ # foxnews.js, foxbusiness.js, foxweather.js, outkick.js, …
│ └── shared.js # Cross-brand route entries
├── env/ # dev / stage / prod: origins, partner URLs, feature flags
├── sites/ # Per-site metadata and overrides (identifiers, hosts)
├── caching/ # Named cache policies (max-age, stale-*, noindex)
└── specs/ # Named response specifications (content-type, JSON:API, etc.)
Routes (settings/routes/)
- Site files define which path patterns exist for each first-segment prefix (
fn,fb, …). shared.jsdefines routes that resolve tosrc/apis/shared/...handlers.- Each route entry typically sets:
routes: pattern strings with{tokens}.variables: allowed values per token (optional).group: directory segment underapis/{site}/.specification: key intosettings/specs.caching: key intosettings/caching.framework: fallback only if no endpointindex.jsexists.
See Router & routes for resolution order.
Environment (settings/env/)
dev,stage,prodJSON (or JS) bundles: partner endpoints, CDN origins, internal service base URLs.MOXIE_ENV(or?env=) selects which env file applies for upstream calls.- Keep secrets out of committed JSON — use Terraform / Lambda env / GitHub Secrets for true secrets; local defaults live in
build/configs/env.js.
Sites (settings/sites/)
- Per-brand configuration: labels, hosts, internal ids used in mapping and staticish tokens (
[[site]], etc.).
Caching (settings/caching/)
- Named policies referenced by route
cachingfield. - Common names:
standard,mobile,liveblog,disabled— see Caching deep dive.
Specifications (settings/specs/)
- Define how the framework sets Content-Type and related headers for
specificationon routes. - Examples:
json,json-api,mobile,xml,swagger— see Response specifications.
Editing discipline
- One route change often requires handler + config + mapping under
src/apis/— keep route keys and directory names in sync. - After changing routes, smoke-test
?debugga=route,configon a representative URL.