summaryrefslogtreecommitdiff
path: root/plugins/dotenv/README.md
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2017-02-27 09:02:16 -0800
committerRobby Russell <robby@planetargon.com>2017-02-27 09:02:16 -0800
commitb908feebcfb0ca8a9a80360d177e716c24c317d6 (patch)
tree966fd789c3bcdf804d6d242a3becf81afc343eaa /plugins/dotenv/README.md
parente609fd5a9f7f7c9a16945ca9c0748b6de99f6635 (diff)
parentd874c73f19d8430f4dc32756fff0bf2f6a804d87 (diff)
downloadzsh-b908feebcfb0ca8a9a80360d177e716c24c317d6.tar.gz
zsh-b908feebcfb0ca8a9a80360d177e716c24c317d6.tar.bz2
zsh-b908feebcfb0ca8a9a80360d177e716c24c317d6.zip
Merge branch 'master' of github.com:robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/dotenv/README.md')
-rw-r--r--plugins/dotenv/README.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md
new file mode 100644
index 000000000..ade09fbb2
--- /dev/null
+++ b/plugins/dotenv/README.md
@@ -0,0 +1,34 @@
+# dotenv
+
+Automatically load your project ENV variables from `.env` file when you `cd` into project root directory.
+
+Storing configuration in the environment is one of the tenets of a [twelve-factor app](http://www.12factor.net). Anything that is likely to change between deployment environments–such as resource handles for databases or credentials for external services–should be extracted from the code into environment variables.
+
+## Installation
+
+Just add the plugin to your `.zshrc`:
+
+```sh
+plugins=(git man dotenv)
+```
+
+## Usage
+
+Create `.env` file inside your project directory and put your local ENV variables there.
+
+For example:
+```sh
+export AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a
+export SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f
+export MONGO_URI=mongodb://127.0.0.1:27017
+export PORT=3001
+```
+`export` is optional. This format works as well:
+```sh
+AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a
+SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f
+MONGO_URI=mongodb://127.0.0.1:27017
+PORT=3001
+```
+
+**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it supposed to be local only.