I have a constant file
export class constants {
public static get API_ENDPOINT(): string { return \'https://dvelopment-server/\'; }
}
I hope it helps.
First, create development.ts, staging.ts, production.ts configuration files. Second, in your index.pug, import the environment file in the following way:
SystemJS.import("#{settings.env}").then(function(env) {
System.import("app").catch(console.error.bind(console));
} // Promise.all also works!
Remember that in nodeJS/Pug/Jade settings.env contains the NODE_ENV value.
And finally, your system.config.ts map should have the following lines:
"development": "myUrl/configs/development.js",
"staging": "myUrl/configs/staging.js",
"production": "myUrl/configs/production.js",