Environment Variables
Fairyfly reads a small set of FF_ variables. There is no FF_PORT — the port comes only from http.serve({ port }) in your JS.
Quick look
Reference
FF_ECHO — smoke mode
Any value enables it — the check is "is the variable set?", so even
FF_ECHO= (empty) counts. Every request gets 200 {"message":"ok"}
without running your handler:
Unset it to restore your handler:
Note: Only unsetting disables echo mode.
FF_ECHO= ff server.js(empty value) does enable it;FF_ECHO=0also enables it (the value is never inspected).
FF_CERT / FF_KEY — TLS without flags
ff start accepts --cert/--key; when the flags are absent, these env vars fill in:
Both must be present together — one without the other fails to start TLS. Explicit flags win over env when both are given. Same file caps as flags: cert ≤ 512KB, key ≤ 256KB. See the TLS guide for generating and verifying.
FF_CA_FILE — trust a private CA
Points fetch and WSS clients at an extra CA bundle (PEM path):
Unlike --ca (which ff start rejects), FF_CA_FILE works everywhere, including ff start. When TLS is started with --cert/FF_CERT, that cert path is additionally trusted by the runtime's own outbound clients — handy for self-signed dev loops.
Reading env in code
process.env is a plain object snapshot of the environment:
Note:
process.envreflects the environment at startup. There is no.envfile loader — export variables in your shell (or prefix the command, as above) before startingff.
Practical example: dev vs prod startup
Troubleshooting
Port env var does nothing — by design. PORT, FF_PORT, and friends are ignored; set the port in http.serve({ port }).
--ca rejected by ff start — expected. Use FF_CA_FILE with ff start; --ca works only with ff <file> and ff -e.
TLS didn't start with env set — both FF_CERT and FF_KEY must be set, files must exist and be within size caps, and explicit --cert/--key flags override env.
Echo mode won't turn off — FF_ECHO= (empty) and FF_ECHO=0 both keep it on. unset FF_ECHO is the only way off.
