I followed the official tutorials and made services for the Apis but absolute url of the Api is hardcoded in services.
I want to keep the base url of Api somewhere s
Usually I put these in the const environment file. If you are using angular-cli, this is already provided for you if not you can create your own:
export const environment = {
production: false,
api: 'http://localhost:4200/api/'
};
You can have multiple environment file, like environment.production.ts, then with angular-cli you would run:
ng build --environment=production
If you are not using angular-cli, pretty sure you can build your own something similar.