Typically, apps require environment-specific configuration. In this specific app, we have the base address of the RESTful API that should change across environments.
Angular provides a basic solution for configuration through its environments feature. Let's use environment configuration with the RESTful API base address, as follows:
- Add the base address in the default environment configuration with the following steps:
- Open the environment.ts file in the src/environments folder.
- Add the base address configuration as follows:
export const environment = { production: false, marketApiBaseUri: 'http://localhost:55564/api/',};
- Add the base address in the production environment configuration:
- Open the environment.prod.ts file. ...