- Hands-On Full Stack Web Development with Angular 6 and Laravel 5
- Fernando Monteiro
- 233字
- 2021-07-23 19:18:54
Environments
Inside of the src/environments folder, we find two configuration files. One is called environment.prod.ts, and the other is environment.ts. The Angular CLI will know what to use, depending on the command that we use; for example, consider the following command:
ng build --env = prod
If we use it, then Angular will use the environment.prod.ts file, and, for the other commands, such as ng serve, it will use environment.ts. This is very useful, especially when we have a local API and one in production, using different paths.
Both files have almost the same code; see environment.prod.ts, as follows:
export const environment = {
production: true
};
The environment.ts file is as follows:
export const environment = {
production: false
};
Note that the Boolean true (on production) and false (on development) is the only difference between the two files, at this first stage. It is clear that, in addition to the files that we mentioned, we have a lot of other files within an Angular application, and all of them are extremely important. But, for now, let's focus on these. Don't worry; throughout the course of the book, we will look at more of them in detail, during the development of our example application. For now, we are going to focus on creating the simple example that we are using in this chapter.
- 計算機網(wǎng)絡(luò)與通信(第2版)
- SOA用戶指南
- SEO 20日
- 物聯(lián)網(wǎng)概論(第2版)
- 智慧城市中的移動互聯(lián)網(wǎng)技術(shù)
- 局域網(wǎng)組建、管理與維護項目教程(Windows Server 2003)
- 中小型局域網(wǎng)組建、管理與維護實戰(zhàn)
- 物聯(lián)網(wǎng)與無線傳感器網(wǎng)絡(luò)
- 計算機網(wǎng)絡(luò)與通信(第2版)
- 網(wǎng)絡(luò)環(huán)境中基于用戶視角的信息質(zhì)量評價研究
- 網(wǎng)絡(luò)工程實施技術(shù)與方案大全
- 轉(zhuǎn)化:提升網(wǎng)站流量和轉(zhuǎn)化率的技巧
- 區(qū)塊鏈社區(qū)運營手冊
- 5G新型多址技術(shù)
- 網(wǎng)絡(luò)分析技術(shù)揭秘:原理、實踐與WinPcap深入解析