diff --git a/fastn.com/FASTN.ftd b/fastn.com/FASTN.ftd index 9a5960ac6..991bb882c 100644 --- a/fastn.com/FASTN.ftd +++ b/fastn.com/FASTN.ftd @@ -662,6 +662,8 @@ skip: true document: best-practices/self-referencing.ftd - Property: /property-guidelines/ document: best-practices/property-guidelines.ftd + - Enviroment Variables: /best-practices/env-vars + document: best-practices/env-vars.ftd ## Fullstack: /dynamic-urls/ document: backend/dynamic-urls.ftd diff --git a/fastn.com/best-practices/env-vars.ftd b/fastn.com/best-practices/env-vars.ftd new file mode 100644 index 000000000..8ddb1c899 --- /dev/null +++ b/fastn.com/best-practices/env-vars.ftd @@ -0,0 +1,26 @@ +-- import: fastn-community.github.io/bling/note + +-- ds.page: Environment Variables + +Environment variables are automatically loaded from your `.env` file. + +-- ds.h3: Automatic Environment Variables Loading with `.env` Files + +By default, the fastn CLI is designed to automatically load environment +variables from an `.env` file located in the current working directory (CWD). +However, please note that this automatic loading will not function if your +`.env` file is committed to a **Git repository**. In such cases, the CLI will +fail issuing a warning message. + +To override this behavior and intentionally use an `.env` file checked into +Git, you can do so by setting the `FASTN_DANGER_ACCEPT_CHECKED_IN_ENV` +environment variable. + +-- ds.code: Override (not recommended) +lang: sh + +FASTN_DANGER_ACCEPT_CHECKED_IN_ENV=true fastn serve + + +-- end: ds.page +