import { config } from '@uhg-abyss/web/tools/config';Dev env config example
Tip
Use config in Abyss workspaces that provide .abyss/environments.json or .env files.
In the example below we are running the config tool in the dev environment. Running config without passing it a value will return the available config including the global variables and environment specific variables. The config method also can accept a variable name and returns its value.
Environment variables
Below is a standard setup for the environment config. Read more about Abyss environment configurations here.
{ "env": { // Global variables "APP_NAME": "Abyss Web Application" }, "env.dev": { // Env specific variables "ENV_VAR": "dev-only" }, "env.test": { "ENV_VAR": "test-only" }, "env.stage": { "ENV_VAR": "stage-only" }, "env.prod": { "ENV_VAR": "prod-only" }}Config
Example config uses:
const allConfigVariables = config();// {// APP_NAME: 'Abyss Web Application',// ENV_VAR: 'dev-only',// }
const appName = config('APP_NAME');// "Abyss Web Application"
const appEnv = config('ENV_VAR');// "dev-only"