pillarjs / discussions

http://pillarjs.github.io
7 stars 0 forks source link

Move express settings management to a new module #14

Open wesleytodd opened 8 years ago

wesleytodd commented 8 years ago

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: https://github.com/wesleytodd/nighthawk/issues/5

Thoughts feedback?

wesleytodd commented 8 years ago

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

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

Download commented 7 years ago

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!