Closed viktorlv30 closed 1 year ago
Maybe I'm doing something wrong?
convict version is 6.0.0
Oh, my bad you can't see the PR status with the link I give you. The PR with the commit was closed because they was to many conflict (one of my first commit/change in this PR was rejected).
You have two solution : Make a new PR (and reproduce the change) or use my fork.
Some links:
Damn, just came here to report exactly this.
@A-312 Any chance you could make a smaller PR that fixes just this issue?
I already did a big work on my fork
@A-312 Oh, that looks interesting! Thanks, I'll have a closer look :)
I need a 'default' key in my config, like
{ "endpoints": { "default": { "base-url": "http://localhost:5000", "path": "/v1" }, "auth": { "base-url": "/auth/v1", "path": "/token" } } }
I create a schema:
const schema = { endpoints: { "default": { "base-url": { default: "http://localhost:5000", doc: 'Default domain', format: String }, "path": { default: "/v1", doc: 'Default API version', format: String } }, auth: { "base-url": { default: "/auth/v1", doc: 'Auth path', format: String }, "path": { default: "/token", doc: 'To get auth token', format: String } } } }
Then, create config with this schema
const config = convict(schema);
After I try to get entire config:
console.log(config.get());
And receive wrong configuration: /{ endpoints: { 'base-url': { default: 'http://localhost:5000', doc: 'Default domain', format: [Function: String] }, path: { default: '/v1', doc: 'Default API version', format: [Function: String] } } }
/But should be: /
{ endpoints: { default: { 'base-url': 'http://localhost:5000', path: '/v1' }, auth: { 'base-url': '/auth/v1', path: '/token' } } }
/