1
I’m on a project where there’s the test environment, and the production environment.
When I am developing in test, I use some different urls for this. I use some Amazon services, and they are different from the production urls.
However, it is very annoying to stay manually, changing the urls, I wonder if there is any good practice to manage this.
That one
app.get('env')
. Where does it come from? How do I let him know it’s production ? @Sergio– Jonathan
@Jonathan O
app.get('env')
is express.js API and this method returns the environment the application is running in. By default it is "Development" but if the production environment is set it returns "Production".– Sergio
You think right inside the
if
me make avar config = require('./config1');
and in theelse
dovar config = require('./config2');
? That is, leave no if, the responsibility to perform a require.– Jonathan