Express: app.set() JSON style

Created on 1 Jul 2019  路  4Comments  路  Source: expressjs/express

Why cant I do this?

app.set({
  'view engine': 'hbs',
  'colors': require('chalk'),
  'functions': require('./lib/functions')(app)
})

instead of doing this?

app.set('view engine', 'hbs')
app.set('colors', require('chalk'))
app.set('functions', require('./lib/functions')(app))

Most helpful comment

See #3218, #3714 & https://github.com/wesleytodd/store-settings

I think this would be a good addition to that module, then could land in either 5 or 6. I feel like there was another discussion about this, but I could not find it. If I were you I would submit a pr to add that on that repo so when we merge those pr's we will just get the new functionality.

All 4 comments

See #3218, #3714 & https://github.com/wesleytodd/store-settings

I think this would be a good addition to that module, then could land in either 5 or 6. I feel like there was another discussion about this, but I could not find it. If I were you I would submit a pr to add that on that repo so when we merge those pr's we will just get the new functionality.

@dougwilson

I am new to open source, and this looks like an easy feature, so I will try to submit a pr for this.

one related PR is closed, other is stale. Closing issue, can re-open if PR gets activity.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zackarychapple picture zackarychapple  路  3Comments

Sunriselegacy picture Sunriselegacy  路  3Comments

gaurav5430 picture gaurav5430  路  3Comments

AndrewEQ picture AndrewEQ  路  4Comments

prashantLio picture prashantLio  路  3Comments