Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
doc: env-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhantk232 authored and amitu committed Nov 2, 2023
1 parent c8d9948 commit 9ebdaab
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions FASTN.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions best-practices/env-vars.ftd
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9ebdaab

Please sign in to comment.