Discover Packages
github.com/mariocarrion/env-vars-example
command
module
Version:
v0.0.0-...-39dbf0d
Opens a new window with list of versions in this module.
Published: Jan 25, 2018
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Environment Variables Example
Really tiny and simple example about using both envconfig and godotenv as a prerequisite for a 12 factor application.
Usage
Without indicating any environment variable it uses the default values:
$ ./env-vars-example
root:@localhost:3306/dbname
but if you set the environment variables, those take preference:
$ DSN_USERNAME=mario DSN_HOST=fancy.com ./env-vars-example
mario:@fancy.com:3306/dbname
Expand ▾
Collapse ▴
Documentation
¶
Simple example for providing default environment variables via an env file
and wrapping those into a struct with the possibility to override them
if needed
Source Files
¶
Click to show internal directories.
Click to hide internal directories.