The Guide provides an example in ES6 for reading variables out of the environment.js file:
However, I want to use one of the values in ENV.APP in a plain old .js file. Specifically, I want to dynamically set an http-proxy target server depending on the environment.
In /server/proxies/api.js I added this code at the top:
var proxyConfig = require('./../../config/environment.js'); console.log( 'Proxy Config: ' + JSON.stringify(proxyConfig, null, 2) );
I get this as the output:
Proxy Config: undefined