Environment variables
Code example
// process is global variable.
if (process.env.NODE_ENV == 'http')
{
console.log('Start HTTP server');
}
else
{
console.log('Start HTTPS server');
}
calling example 1:
$ NODE_ENV=http node index.js
Start HTTP server # output
calling example 2:
$ NODE_ENV=https node index.js
Start HTTPS server # output