I have a problem which I know has solutions but I am not sure how to implement it. I have a file that reads a server URL in src folder. But depending on the environment configuration, I need to read the server URL from the root folder into the TypeScript file in src folder. How can it be done?
Currently in my TypeScript file, I have this line:
export const ServerURL = <serverURL>;
I am importing this file into other components which use the server URL.
import { ServerURL } from '../file-path';
Now I need to read this ServerURL from a config file in the root of this application. Do we use a separate JavaScript or JSON file to read the server URL or can it be done in the systemjs.config.js file which is one of the main files of the application? Any advice would be great!