My API Url is hardcoded to localhost:4300 in my Development environment ( which is in utilities.ts)
These are the codes below
utilities.ts
const hostToApiUrlMap = {
localhost: 'http://localhost:4300'
};
environment.prod.ts
export const environment {
production: true
};
environment.ts
export const environment {
production: false
};
I know when we move to Production environment the API Url will change.
My question is "How can I use Environment Variables to configure the API Url on the frontend so that it is not Hardcoded to localhost:4300?
So that whenever the API Url changes, the Development environment will automatically update to the new API Url