Skip to content

Commit

Permalink
uppdate readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Mar 28, 2018
1 parent be0a1f9 commit 0d79a25
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,32 @@ dotenv["HOME"]

**Kotlin Dsl example**

```java
```kotlin
dotenv {
directory = "/some/path"
}
```

### *optional* `filename`

* Recommended for use with Android (see [details](#android-usage))
* Optionally use a filename other than `.env`

**Java example**

```java
Dotenv
.configure()
.filename("myenv")
.load()
```
**Kotlin Dsl example**

```kotlin
dotenv {
filename = "myenv"
}
```

### *optional* `ignoreIfMalformed`

Expand All @@ -170,7 +190,7 @@ dotenv["HOME"]
```
**Kotlin Dsl example**

```java
```kotlin
dotenv {
ignoreIfMalformed = true
}
Expand All @@ -190,7 +210,7 @@ dotenv["HOME"]
```
**Kotlin Dsl example**

```java
```kotlin
dotenv {
ignoreIfMissing = true
}
Expand All @@ -209,6 +229,14 @@ dotenv["HOME"]

**A**: Since Java does not provide a way to set environment variables on a currently running process, vars listed in `.env` cannot be set and thus cannot be retrieved using `System.getenv(...)`.

**Q:** Should I have multiple .env files?

**A**: No. We strongly recommend against having a "main" .env file and an "environment" .env file like .env.test. Your config should vary between deploys, and you should not be sharing values between environments.

> In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime.
>– The Twelve-Factor App
**Q**: Should I commit my `.env` file?

**A**: No. We strongly recommend against committing your `.env` file to version control. It should only include environment-specific values such as database passwords or API keys. Your production database should have a different password than your development database.
Expand All @@ -233,5 +261,3 @@ see [CONTRIBUTING.md](CONTRIBUTING.md)

see [LICENSE](LICENSE) ([Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0))



0 comments on commit 0d79a25

Please sign in to comment.