flatiron/nconf — Issue #15: using several stores / overrides - merges not as expected
Author: jondot
Created: 2011-11-16 10:55:42+00:00
State: open

Hi,
I'm trying to set up store as such:

conf.add 'user', { type: 'file', file: 'config/config.local.json' }
conf.add 'global', { type: 'file', file: 'config/config.json' }

I then expect the user values to override the global values such that:

# user
{ port:4000}

# global
{ port:80}

but in every case i'm getting port:80 being resloved.
if i reverse the order like so:

conf.add 'global', { type: 'file', file: 'config/config.json' }
conf.add 'user', { type: 'file', file: 'config/config.local.json' }

then i get undefined values, because global declares more values than in user.

# global
{ port:80, db:"host"}

# user
{ port:4000}

db is undefined -- seems to be overriden in user - but i'm not specifying it there in any case and expecting it to be merged from global.

anything i'm doing wrong here?

Thanks!