pillarjs/discussions

Move express settings management to a new module

Opened this issue · 2 comments

Another nice module to have would be the settings management that express has:

app.set('foo', 'bar');
app.get('foo') // bar

For the things that express specifically defaults or modifies, for example query parser, I was thinking of just adding a setter registry:

app.setter('foo', function (val) {
  return 'foo' + val;
});
app.set('foo', 'bar');
app.get('foo') // foobar

My main use case here is to also share this functionality to my front end implementation as talked about here: wesleytodd/nighthawk#5

Thoughts feedback?

I made a quick module for this, is there any interest in this?

https://github.com/wesleytodd/store-settings

Imho this would be very useful. I am looking to use express as the highest level abstraction to define isomorphic/universal apps... Currently both @wesleytodd and myself have basically re-implemented Express' settings module to be compatible with it, but it would be so much better to use the real thing!