> For the complete documentation index, see [llms.txt](https://docs.nesula.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nesula.com/overview/configuration.md).

# Configuration

Configure Nesula for different environments

Nesula has default configuraiton files for three environments:

* Development
* Staging
* Production

When deployment scripts are run the file for that environment replaces the file Angular or NestJS applications use.

{% hint style="warning" %}
Do not update the environment.ts & .env files directly as are there are overwritten every deployment. Instead update the file for that environment
{% endhint %}

### Environment Configuration Files

| Environment      | Angular              | NestJS     |
| ---------------- | -------------------- | ---------- |
| File Nesula uses | environment.ts       | .env       |
| Development      | environment.dev.ts   | .env.dev   |
| Staging          | environment.stage.ts | .env.stage |
| Production       | environment.prod.ts  | .env.prod  |

### Node Process Environment

Values from the NestJS .env file are loaded in the node run time e.g. NODE\_ENV

They are available in NestJS as:

```
process.env.NODE_ENV
```

### Configuration Service

Nesula provides configuration services to access environment data for both Angular & NestJS.&#x20;

#### NestJS

Environment configuration service is available in NestJS as follows:

The .env files are loaded into the config module in app.module.ts from file:

```
import configuration from './_common/config/configuration'
```

With the application this config may be access by:

```
import { ConfigService } from '@nestjs/config'

...

appUrl: string = this.configService.get('url.app')

```

#### Angular

Environment configuration is available directly from the environment file:

```
import { environment } from '@environments/environment'

...

baseUrl = environment.apiUrl;
```
