> For the complete documentation index, see [llms.txt](https://bamtech.gitbook.io/dev-standards/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bamtech.gitbook.io/dev-standards/backend/node-js/add-multiple-environments-configuration-on-loopback.s.md).

# add-multiple-environments-configuration-on-loopback.s

## \[Standard] Add multiple environments configuration on loopback

### Owner: Maxime Sraïki

## Why

Whenever you are developing a loopback application, you'll need to have multiple environments in order to control the impact of your development team on the other environments: dev, staging, prod...

### Checks

* You need to have a root configuration file with all the trans environment datas
* Each environment specific configuration file has to be named with the same standard
* Each environment specific configuration file has to have only the informations of its own environment

### Examples

### Bad Examples

#### Example 1: Wrong configuration files naming, they don't respect the same pattern

![Wrong configuration files naming](https://804060054-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L3CidFRQ0Q6KxD-8XNl%2F-LCDiQWqdw4tFop3xeTn%2F-LCDiXNertlDpbLbG_do%2Fbad-configuration-naming-example.png?generation=1526034214139271\&alt=media)

#### Example 2: Multiple environments variables in one config file

```javascript
{
  "key1": "value1",
  "key2": "value2",
  "key3": {
    "staging": "value3-staging",
    "prod": "value3-prod",
  }
}
```

### Good Examples

#### Example 1: Good configuration files naming

![Good configuration files naming](https://804060054-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L3CidFRQ0Q6KxD-8XNl%2F-LCDiQWqdw4tFop3xeTn%2F-LCDiXR-_fgdGkYqkxfx%2Fgood-configuration-naming-example.png?generation=1526034214984278\&alt=media)

#### Example 2: Only own environments variables in one config file

```javascript
{
  "key1": "value1",
  "key2": "value2",
  "key3": "value3"
}
```
