The Environment Files

The environment settings files

Within our application, we have two environment files as standard. There’s one for development,environment.ts, and one for production, environment.prod.ts. Both of these files can be found in the /environments folder of our application. Within these files, we can add any environmental settings we want to access within our code.

Example

For example, we could set the main API URL. Then, in the development version, we have a development URL, which points to a dev server. And in the production environments file, the same URL points to the live product URL.

This is what the environment.ts file could look like with an API URL for development:

Get hands-on with 1200+ tech skills courses.