Reader small image

You're reading from  Angular Design Patterns and Best Practices

Product typeBook
Published inFeb 2024
Reading LevelIntermediate
PublisherPackt
ISBN-139781837631971
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Alvaro Camillo Neto
Alvaro Camillo Neto
author image
Alvaro Camillo Neto

Alvaro is a software engineer, speaker and instructor in Brazil. He works in the technology industry for over 10 years dedicated to the development of business solutions in a large company in the industry. Alvaro is a technology enthusiast and sees knowledge sharing as an opportunity to help the community that helped him so much and the best way of learning. He has performed from small meetups to large events focusing on the themes of developing web solutions. He also shares knowledge on his blog and participates in the organization of AngularSP.
Read more about Alvaro Camillo Neto

Right arrow

Differentiating environments

After finishing the task of deploying our backend, we need to change our frontend project to make requests to our cloud infrastructure. But here, a problem arises. We want to access our published backend when we are in production, but the team needs to continue accessing the API locally to develop new features in a more practical way. How can we have the best of both worlds?

The answer to this, once again, was thought up by the Angular team and is the creation of configuration files for each development environment.

Until version 14 of Angular, these files were already standard when creating the project (the ng new command). However, to simplify new projects and reduce the learning curve, these files were removed for new projects.

But we shouldn’t worry because to add them, we can use the Angular CLI. On the command line, use the following command:

ng generate environments

After executing the preceding command, the Angular CLI creates...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Angular Design Patterns and Best Practices
Published in: Feb 2024Publisher: PacktISBN-13: 9781837631971

Author (1)

author image
Alvaro Camillo Neto

Alvaro is a software engineer, speaker and instructor in Brazil. He works in the technology industry for over 10 years dedicated to the development of business solutions in a large company in the industry. Alvaro is a technology enthusiast and sees knowledge sharing as an opportunity to help the community that helped him so much and the best way of learning. He has performed from small meetups to large events focusing on the themes of developing web solutions. He also shares knowledge on his blog and participates in the organization of AngularSP.
Read more about Alvaro Camillo Neto