Stok Config provides a method for loading configuration values form environment variables for twelve-factor apps.
const http =const loadConfiguration =const config =const server = httpserver
loadConfiguration(config) Returns: Object
Loads configuration from environment variables and the
.env file and stores it in a structured object.
config(Object): A mapping between a structured config object and the associated env vars.
In the following example,
web.port will have the value of the
PORT env var. Similarly,
db.password will have the values of the
DB_PASSWORD env vars, respectively.
db.port will have the value of the
DB_PORT env var, but if the env var doesn't exist, the default value of
3306 will be used.
const config =
Copyright Stok Config contributors. Released under the terms of the ISC license.