set node process env code example
Example 1: set a variable in express.js
app.set('oneSetting', 'one');
app.set('twoSetting', 'two');
app.set('view engine','jade');
console.log(app.settings.oneSetting);
console.log(app.settings.twoSetting);
console.log(app.settings['view engine']);
Example 2: node how to set environment variable
// get an environment variableexport const token = process.env['API_TOKEN'];// set an environment variable at runtimeprocess.env['RANDOM_ID'] = Math.random();