Closed Raynos closed 9 years ago
:+1:
Can we also make a 'defaults' option? Just like seed, except all the config-chain items overwrite it, instead of it overwriting them?
defaults is called config/common.json
use json files.
@Raynos I don't want defaults to be project-dependent, but rather module-dependent. Let's say you'd like to use bedrock (without playdoh):
var bedrock = require('bedrock');
bedrock.createServer(function (server) {
server.get('/', function (req, res) { res.send('Hello!'); });
server.listen();
});
That will just crash, because you need to also write a giant file (or copy it from somewhere?) into your project/config/common.json. Not sure if that's a good pattern (especially for "zero-config"... might as well call it "lots-of-config" :P ).
config is part of your app and will stay in your app.
We already scaffold a ton of shit, might as well scaffold config too.
Putting it into a shared library puts you in update hell.
This adds a seed option to the zero-config module.
This use case is currently done adhoc in the server.js of applications using zero-config.
cc @Matt-Esch @sh1mmer