Skip to contents

configulaR currently supports only .env files. `get_config` will search if the speficied directory and its parent a `.env` file. If no file is found, a empty list is returned.

Usage

get_config(path = NULL)

Arguments

path

a path from where a config if searched for. Parent directories will be evaluated if no config file is found is the specified directory. If NULL, the current directory will be taken as default.

Value

a list with variables / values from config file. If no config file has been found, an empyt list is returned.

Details

## Env file:

Simply create a .env text file on your repository's root directory in the form:


DEBUG=True
TEMPLATE_DEBUG=True
SECRET_KEY=ARANDOMSECRETKEY
DATABASE_URL=mysql://myuser:mypassword@myhost/mydatabase
PERCENTILE=90
#COMMENTED=42

Examples

config <- get_config()
config
#> list()