Local development
The fn-moxie-api repo uses Yarn only — npm will fail (enforced in preinstall).
Prerequisites
- Node version from
.nvmrc(seebuild/scripts/check-node.js). - Clone github.com/foxnews/fn-moxie-api and run
yarn install.
Everyday commands
| Command | Description |
|---|---|
yarn dev |
Local server + Webpack watch, dev backend data (default) |
yarn dev:stage |
Same, stage data |
yarn dev:prod |
Same, prod data |
yarn dev:debug |
Dev with Node --inspect |
yarn dev:clean |
Clean build/dist then start dev |
yarn dev:tunnel |
Dev with Unmoxed tunnel (needs token — see Unmoxed & tunnels) |
yarn build / yarn build:dev / yarn build:stage |
Webpack production builds |
yarn test |
Jest |
yarn lint / yarn lint:fix |
Biome on src/ |
yarn format |
Biome format src/ + build/ |
Aliases such as yarn local:dev, yarn serve:dev, etc. map to the same dev entry.
Server URL
Default: http://localhost:3001
Smoke test: http://localhost:3001/fn/hello
Older docs sometimes reference port 3000 or
yarn serve:dev— the canonical port in current tooling is 3001.
Environments
MOXIE_ENV:dev|stage|prod- Query override:
?env=dev|stage|prodon any request
Local env and secrets
build/configs/env.js: Brightcove tokens (FN/FB), secret names, and other defaults for local dev — no extra setup for many video endpoints..env: optional (see.env.examplein repo) for tunnel tokens, etc.UNMOXED: set for local dev to bypass CDN checks when needed.UNMOXED_SERVER: e.g.http://localhost:3099to point the tunnel client at a local unmoxed-server.UNMOXED_TOKEN: Bearer token when the remote tunnel server requires JWT.
Static and S3-shaped URLs (local)
/static/...→static/public/...(production-shaped public paths)/s3/...→ bucket root for browsingstatic/publicandstatic/private
Runtime query helpers
?debugga=<flag>— see Debugging?env=— environment override for upstream fetches
CLI: moxie
The repo exposes yarn bin moxie (build/scripts/moxie.js) for auth and serve flows; day-to-day local API work is usually yarn dev. See Setup for initial project setup.
See also
- Documentation map — all guides
- Webpack & Lambda bundle — how
yarn buildworks - Troubleshooting — when local dev misbehaves