set a variable in express.js 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']);

Here is what the above code is Doing:
1. We’re creating a new Express application.
2. We’re setting three settings: oneSetting, twoSetting, and view engine.
3. We’re logging the value of each setting to the console.

The output of the above code is:
one
two
jade

Similar Posts