Last active
January 1, 2018 15:52
-
-
Save cdimascio/cb5b1ab6aa083a3764fe8c4c9e84c898 to your computer and use it in GitHub Desktop.
Dotenv Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# formatted as key=value | |
MY_ENV_VAR1=some_value | |
MY_EVV_VAR2=some_value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dotenv dotenv = Dotenv.configure() | |
.directory("./some/path") | |
.ignoreIfMalformed() | |
.ignoreIfMissing() | |
.load(); | |
dotenv.get("MY_ENV_VAR1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.github.cdimascio.dotenv.Dotenv; | |
Dotenv dotenv = Dotenv.load(); | |
dotenv.get("MY_ENV_VAR1") | |
dotenv.get("HOME") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val dotenv = dotenv { | |
directory = "./some/path" | |
ignoreIfMalformed = true | |
ignoreIfMissing = true | |
} | |
dotenv["MY_ENV_VAR1"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.github.cdimascio.dotenv.dotenv | |
val dotenv = dotenv() | |
dotenv["MY_ENV_VAR1"] | |
dotenv["HOME"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment