From b0d91cdbe5d4725667dcb1ddc7615d8890b4b55a Mon Sep 17 00:00:00 2001 From: siddhantCodes Date: Sat, 28 Oct 2023 12:35:47 +0530 Subject: [PATCH] doc: env-vars document https://github.com/fastn-stack/fastn/pull/1425 --- FASTN.ftd | 2 ++ best-practices/env-vars.ftd | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 best-practices/env-vars.ftd diff --git a/FASTN.ftd b/FASTN.ftd index 3de061412..59ab5bb1e 100644 --- a/FASTN.ftd +++ b/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/best-practices/env-vars.ftd b/best-practices/env-vars.ftd new file mode 100644 index 000000000..8ddb1c899 --- /dev/null +++ b/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 +