Angular CLI: Change REST API URL on build

Dont hard code the URL. Use environment.prod.ts and environment.ts files which are inside src/environments. for localhost, in environment.ts file use some variable to save your url. export const environment = { production: false, API_URL: ‘http://localhost:8080’, }; for production, in environment.prod.ts export const environment = { production: true, API_URL: ‘http://api.productionurl.com’, }; When using in your code … Read more

error code: 521